mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-01-02 18:36:24 +01:00
Compare commits
27 Commits
leilzh/cal
...
user/yeela
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d868a85b87 | ||
|
|
abc5c3e249 | ||
|
|
ce058f1dc7 | ||
|
|
2d1676b7df | ||
|
|
8506b47544 | ||
|
|
2b40c4d2f3 | ||
|
|
38cae3ead8 | ||
|
|
e5b2b7fe82 | ||
|
|
a2c9517bed | ||
|
|
e9dbcbaebb | ||
|
|
6e0f1819d5 | ||
|
|
3f834d7a6b | ||
|
|
e9a79f5d6f | ||
|
|
a9c5117f61 | ||
|
|
b9aac70de5 | ||
|
|
55b9b52349 | ||
|
|
13a7ceba6d | ||
|
|
e14ace4bfc | ||
|
|
549ce60483 | ||
|
|
51b6e41d93 | ||
|
|
0d29f6aca6 | ||
|
|
edffb99073 | ||
|
|
310186c44c | ||
|
|
6d303af726 | ||
|
|
84296b0d89 | ||
|
|
7417b857e8 | ||
|
|
4f3f7d649f |
@@ -2,14 +2,14 @@
|
||||
# Reference: https://github.com/microsoft/PowerToys/blob/main/doc/devdocs/readme.md#compiling-powertoys
|
||||
properties:
|
||||
resources:
|
||||
- resource: Microsoft.Windows.Developer/DeveloperMode
|
||||
- resource: Microsoft.Windows.Settings/WindowsSettings
|
||||
directives:
|
||||
description: Enable Developer Mode
|
||||
allowPrerelease: true
|
||||
# Requires elevation for the set operation
|
||||
securityContext: elevated
|
||||
settings:
|
||||
Ensure: Present
|
||||
DeveloperMode: true
|
||||
- resource: Microsoft.WinGet.DSC/WinGetPackage
|
||||
id: vsPackage
|
||||
directives:
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
# Reference: https://github.com/microsoft/PowerToys/blob/main/doc/devdocs/readme.md#compiling-powertoys
|
||||
properties:
|
||||
resources:
|
||||
- resource: Microsoft.Windows.Developer/DeveloperMode
|
||||
- resource: Microsoft.Windows.Settings/WindowsSettings
|
||||
directives:
|
||||
description: Enable Developer Mode
|
||||
allowPrerelease: true
|
||||
# Requires elevation for the set operation
|
||||
securityContext: elevated
|
||||
settings:
|
||||
Ensure: Present
|
||||
DeveloperMode: true
|
||||
- resource: Microsoft.WinGet.DSC/WinGetPackage
|
||||
id: vsPackage
|
||||
directives:
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
# Reference: https://github.com/microsoft/PowerToys/blob/main/doc/devdocs/readme.md#compiling-powertoys
|
||||
properties:
|
||||
resources:
|
||||
- resource: Microsoft.Windows.Developer/DeveloperMode
|
||||
- resource: Microsoft.Windows.Settings/WindowsSettings
|
||||
directives:
|
||||
description: Enable Developer Mode
|
||||
allowPrerelease: true
|
||||
# Requires elevation for the set operation
|
||||
securityContext: elevated
|
||||
settings:
|
||||
Ensure: Present
|
||||
DeveloperMode: true
|
||||
- resource: Microsoft.WinGet.DSC/WinGetPackage
|
||||
id: vsPackage
|
||||
directives:
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -12,7 +12,7 @@ body:
|
||||
attributes:
|
||||
label: Microsoft PowerToys version
|
||||
placeholder: X.XX.X
|
||||
description: Hover over system tray icon or look at Settings
|
||||
description: Hover over the system tray icon or look at Settings
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -20,7 +20,7 @@ body:
|
||||
type: dropdown
|
||||
attributes:
|
||||
label: Installation method
|
||||
description: How / Where was PowerToys installed from?
|
||||
description: How / where was PowerToys installed from?
|
||||
multiple: true
|
||||
options:
|
||||
- GitHub
|
||||
|
||||
@@ -6,7 +6,7 @@ labels:
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Provide a description of requested docs changes
|
||||
label: Describe the requested doc changes
|
||||
placeholder: Briefly describe which document needs to be corrected and why.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
2
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -13,7 +13,7 @@ body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Scenario when this would be used?
|
||||
placeholder: What is the scenario this would be used? Why is this important to your workflow as a power user?
|
||||
placeholder: What is the scenario this would be used in? Why is this important to your workflow as a power user?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/translation_issue.yml
vendored
4
.github/ISSUE_TEMPLATE/translation_issue.yml
vendored
@@ -14,7 +14,7 @@ body:
|
||||
attributes:
|
||||
label: Microsoft PowerToys version
|
||||
placeholder: 0.70.0
|
||||
description: Hover over system tray icon or look at Settings
|
||||
description: Hover over the system tray icon or look at Settings
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
@@ -65,7 +65,7 @@ body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: ❌ Actual phrase(s)
|
||||
placeholder: What is there? Please include a screenshot as that is extremely helpful.
|
||||
placeholder: What is there? Please include a screenshot, as that is extremely helpful.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
|
||||
4
.github/actions/spell-check/allow/names.txt
vendored
4
.github/actions/spell-check/allow/names.txt
vendored
@@ -91,6 +91,7 @@ Hemmerlein
|
||||
hlaueriksson
|
||||
Horvalds
|
||||
Howett
|
||||
hotkidfamily
|
||||
htcfreek
|
||||
Huynh
|
||||
Ionut
|
||||
@@ -98,6 +99,7 @@ jamrobot
|
||||
Jaswal
|
||||
Jaylyn
|
||||
jefflord
|
||||
Jeremic
|
||||
Jordi
|
||||
jyuwono
|
||||
kai
|
||||
@@ -173,6 +175,7 @@ Tadele
|
||||
talynone
|
||||
Taras
|
||||
TBM
|
||||
Teutsch
|
||||
tilovell
|
||||
Triet
|
||||
urnotdfs
|
||||
@@ -221,6 +224,7 @@ openai
|
||||
Quickime
|
||||
regedit
|
||||
roslyn
|
||||
Skia
|
||||
Spotify
|
||||
Vanara
|
||||
wangyi
|
||||
|
||||
3
.github/actions/spell-check/excludes.txt
vendored
3
.github/actions/spell-check/excludes.txt
vendored
@@ -92,6 +92,7 @@
|
||||
^\.github/actions/spell-check/
|
||||
^\.gitmodules$
|
||||
^\Q.github/workflows/spelling2.yml\E$
|
||||
^\Q.pipelines/272MSSharedLibSN2048.snk\E$
|
||||
^\Q.pipelines/ESRPSigning_core.json\E$
|
||||
^\Qdoc/devdocs/localization.md\E$
|
||||
^\Qsrc/common/ManagedCommon/ColorFormatHelper.cs\E$
|
||||
@@ -120,7 +121,9 @@
|
||||
^src/modules/MouseWithoutBorders/App/Form/.*\.resx$
|
||||
^src/modules/MouseWithoutBorders/App/Helper/.*\.resx$
|
||||
^src/modules/previewpane/UnitTests-MarkdownPreviewHandler/HelperFiles/MarkdownWithHTMLImageTag\.txt$
|
||||
^src/modules/ZoomIt/ZoomIt/ZoomIt\.idc$
|
||||
^src/Monaco/
|
||||
^src/common/sysinternals/Eula/
|
||||
^tools/Verification scripts/Check preview handler registration\.ps1$
|
||||
ignore$
|
||||
^src/modules/registrypreview/RegistryPreviewUILib/Controls/HexBox/.*$
|
||||
|
||||
29
.github/actions/spell-check/expect.txt
vendored
29
.github/actions/spell-check/expect.txt
vendored
@@ -69,6 +69,7 @@ appwiz
|
||||
APSTUDIO
|
||||
AQS
|
||||
ARandom
|
||||
Arash
|
||||
ARCHITEW
|
||||
ARemapped
|
||||
ARPINSTALLLOCATION
|
||||
@@ -328,7 +329,6 @@ DEFAULTTONULL
|
||||
DEFAULTTOPRIMARY
|
||||
DEFERERASE
|
||||
DEFPUSHBUTTON
|
||||
DEFT
|
||||
deinitialization
|
||||
DELA
|
||||
DELETEDKEYIMAGE
|
||||
@@ -470,6 +470,7 @@ EXPCMDFLAGS
|
||||
EXPCMDSTATE
|
||||
explr
|
||||
exppowertoys
|
||||
exprtk
|
||||
exptas
|
||||
exsb
|
||||
exstyle
|
||||
@@ -670,7 +671,6 @@ IBeam
|
||||
icf
|
||||
ICONERROR
|
||||
ICONLOCATION
|
||||
idc
|
||||
IDCANCEL
|
||||
IDD
|
||||
idk
|
||||
@@ -681,7 +681,6 @@ IDR
|
||||
IDXGI
|
||||
ietf
|
||||
IEXPLORE
|
||||
iextn
|
||||
IFACEMETHOD
|
||||
IFACEMETHODIMP
|
||||
IFile
|
||||
@@ -720,7 +719,6 @@ INPUTMOUSE
|
||||
INPUTSINK
|
||||
INPUTTYPE
|
||||
INSTALLDESKTOPSHORTCUT
|
||||
INSTALLDIR
|
||||
installdir
|
||||
INSTALLFOLDER
|
||||
INSTALLFOLDERTOBOOTSTRAPPERINSTALLFOLDER
|
||||
@@ -756,6 +754,7 @@ iwr
|
||||
jfif
|
||||
jgeosdfsdsgmkedfgdfgdfgbkmhcgcflmi
|
||||
jjw
|
||||
JLO
|
||||
jobject
|
||||
jpe
|
||||
jpnime
|
||||
@@ -812,7 +811,6 @@ LMENU
|
||||
lnks
|
||||
LOADFROMFILE
|
||||
LOBYTE
|
||||
localappdata
|
||||
LOCALDISPLAY
|
||||
localpackage
|
||||
LOCALSYSTEM
|
||||
@@ -912,6 +910,7 @@ metafile
|
||||
mfc
|
||||
Mgmt
|
||||
Microwaved
|
||||
middleclickaction
|
||||
midl
|
||||
mii
|
||||
mindaro
|
||||
@@ -977,7 +976,6 @@ msrc
|
||||
msstore
|
||||
mst
|
||||
msvcp
|
||||
msvsmon
|
||||
MTND
|
||||
MULTIPLEUSE
|
||||
multizone
|
||||
@@ -1155,6 +1153,7 @@ PARTIALCONFIRMATIONDIALOGTITLE
|
||||
PATCOPY
|
||||
PATHMUSTEXIST
|
||||
PATINVERT
|
||||
partow
|
||||
PATPAINT
|
||||
pbc
|
||||
pbi
|
||||
@@ -1253,6 +1252,7 @@ prg
|
||||
prgh
|
||||
prgms
|
||||
pri
|
||||
primaryclickaction
|
||||
PRINTCLIENT
|
||||
printmanagement
|
||||
prm
|
||||
@@ -1284,7 +1284,6 @@ pstm
|
||||
PStr
|
||||
pstream
|
||||
pstrm
|
||||
pswd
|
||||
PSYSTEM
|
||||
psz
|
||||
ptb
|
||||
@@ -1429,6 +1428,7 @@ SDKDDK
|
||||
sdns
|
||||
searchterm
|
||||
SEARCHUI
|
||||
secondaryclickaction
|
||||
SECONDARYDISPLAY
|
||||
secpol
|
||||
securestring
|
||||
@@ -1476,16 +1476,12 @@ SHELLDLL
|
||||
shellex
|
||||
SHELLEXECUTEINFO
|
||||
SHELLEXECUTEINFOW
|
||||
SHELLEXTENSION
|
||||
SHELLICONSIZE
|
||||
SHELLNEWVALUE
|
||||
SHFILEINFO
|
||||
SHFILEOPSTRUCT
|
||||
SHGDN
|
||||
SHGDNF
|
||||
SHGFI
|
||||
SHGFIICON
|
||||
SHGFILARGEICON
|
||||
SHIL
|
||||
shinfo
|
||||
shlwapi
|
||||
@@ -1517,9 +1513,9 @@ SICHINT
|
||||
SIDs
|
||||
siex
|
||||
sigdn
|
||||
Signedness
|
||||
SIGNINGSCENARIO
|
||||
signtool
|
||||
Signtool
|
||||
SINGLEKEY
|
||||
sipolicy
|
||||
SIZEBOX
|
||||
@@ -1695,7 +1691,6 @@ TLayout
|
||||
tlb
|
||||
tlbimp
|
||||
tlc
|
||||
TGM
|
||||
TNP
|
||||
Toolhelp
|
||||
toolkitconverters
|
||||
@@ -1783,7 +1778,6 @@ uxtheme
|
||||
vabdq
|
||||
validmodulename
|
||||
valuegenerator
|
||||
VARENUM
|
||||
variantassignment
|
||||
vcamp
|
||||
VCENTER
|
||||
@@ -2003,11 +1997,6 @@ CLSCTXINPROCALL
|
||||
IIDI
|
||||
irow
|
||||
lcid
|
||||
OTHERUNZOOM
|
||||
OTHERZOOM
|
||||
PARENTCLOSING
|
||||
PARENTOPENING
|
||||
ppwsz
|
||||
rguid
|
||||
SCROLLCHILDREN
|
||||
VARTYPE
|
||||
VARTYPE
|
||||
|
||||
2
.github/actions/spell-check/patterns.txt
vendored
2
.github/actions/spell-check/patterns.txt
vendored
@@ -243,4 +243,4 @@ Process Process
|
||||
|
||||
# ZoomIt menu items with accelerator keys
|
||||
E&xit
|
||||
St&yle
|
||||
St&yle
|
||||
|
||||
6
.github/pull_request_template.md
vendored
6
.github/pull_request_template.md
vendored
@@ -5,9 +5,9 @@
|
||||
## PR Checklist
|
||||
|
||||
- [ ] **Closes:** #xxx
|
||||
- [ ] **Communication:** I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
|
||||
- [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
|
||||
- [ ] **Tests:** Added/updated and all pass
|
||||
- [ ] **Localization:** All end user facing strings can be localized
|
||||
- [ ] **Localization:** All end-user-facing strings can be localized
|
||||
- [ ] **Dev docs:** Added/updated
|
||||
- [ ] **New binaries:** Added on the required places
|
||||
- [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries
|
||||
@@ -16,7 +16,7 @@
|
||||
- [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
|
||||
- [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx
|
||||
|
||||
<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
|
||||
<!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here -->
|
||||
## Detailed Description of the Pull Request / Additional comments
|
||||
|
||||
<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
|
||||
|
||||
39
.github/workflows/package-submissions.yml
vendored
39
.github/workflows/package-submissions.yml
vendored
@@ -1,5 +1,4 @@
|
||||
name: WinGet submission on release
|
||||
# based off of https://github.com/nushell/nushell/blob/main/.github/workflows/winget-submission.yml
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -9,23 +8,31 @@ on:
|
||||
jobs:
|
||||
winget:
|
||||
name: Publish winget package
|
||||
|
||||
# winget-create is only supported on Windows
|
||||
runs-on: windows-latest
|
||||
|
||||
# winget-create will read the following environment variable to access the GitHub token needed for submitting a PR
|
||||
# See https://aka.ms/winget-create-token
|
||||
env:
|
||||
WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.PT_WINGET }}
|
||||
|
||||
# Only submit stable releases
|
||||
if: ${{ !github.event.release.prerelease }}
|
||||
steps:
|
||||
- name: Submit Microsoft.PowerToys package to Windows Package Manager Community Repository
|
||||
run: |
|
||||
# Get installer info from GitHub release event
|
||||
$assets = '${{ toJSON(github.event.release.assets) }}' | ConvertFrom-Json
|
||||
$x64UserInstallerUrl = $assets | Where-Object -Property name -match 'PowerToysUserSetup.*x64' | Select -ExpandProperty browser_download_url
|
||||
$x64MachineInstallerUrl = $assets | Where-Object -Property name -match 'PowerToysSetup.*x64' | Select -ExpandProperty browser_download_url
|
||||
$arm64UserInstallerUrl = $assets | Where-Object -Property name -match 'PowerToysUserSetup.*arm64' | Select -ExpandProperty browser_download_url
|
||||
$arm64MachineInstallerUrl = $assets | Where-Object -Property name -match 'PowerToysSetup.*arm64' | Select -ExpandProperty browser_download_url
|
||||
$packageVersion = (${{ toJSON(github.event.release.tag_name) }}).Trim('v')
|
||||
|
||||
$wingetPackage = "Microsoft.PowerToys"
|
||||
$gitToken = "${{ secrets.PT_WINGET }}"
|
||||
|
||||
$github = Invoke-RestMethod -uri "https://api.github.com/repos/Microsoft/PowerToys/releases"
|
||||
|
||||
$targetRelease = $github | Where-Object -Property name -match 'Release'| Select -First 1
|
||||
$installerUserX64Url = $targetRelease | Select -ExpandProperty assets -First 1 | Where-Object -Property name -match 'PowerToysUserSetup.*x64' | Select -ExpandProperty browser_download_url
|
||||
$installerMachineX64Url = $targetRelease | Select -ExpandProperty assets -First 1 | Where-Object -Property name -match 'PowerToysSetup.*x64' | Select -ExpandProperty browser_download_url
|
||||
$installerUserArmUrl = $targetRelease | Select -ExpandProperty assets -First 1 | Where-Object -Property name -match 'PowerToysUserSetup.*arm64' | Select -ExpandProperty browser_download_url
|
||||
$installerMachineArmUrl = $targetRelease | Select -ExpandProperty assets -First 1 | Where-Object -Property name -match 'PowerToysSetup.*arm64' | Select -ExpandProperty browser_download_url
|
||||
$ver = $targetRelease.tag_name -ireplace '^v'
|
||||
|
||||
# getting latest wingetcreate file
|
||||
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
|
||||
.\wingetcreate.exe update $wingetPackage -s -v $ver -u "$installerUserX64Url|user" "$installerMachineX64Url|machine" "$installerUserArmUrl|user" "$installerMachineArmUrl|machine" -t $gitToken
|
||||
# Update package using wingetcreate
|
||||
curl.exe -JLO https://aka.ms/wingetcreate/latest
|
||||
.\wingetcreate.exe update Microsoft.PowerToys `
|
||||
--version $packageVersion `
|
||||
--urls "$x64UserInstallerUrl|user" "$x64MachineInstallerUrl|machine" "$arm64UserInstallerUrl|user" "$arm64MachineInstallerUrl|machine" `
|
||||
--submit
|
||||
|
||||
8
.github/workflows/spelling2.yml
vendored
8
.github/workflows/spelling2.yml
vendored
@@ -93,7 +93,7 @@ jobs:
|
||||
steps:
|
||||
- name: check-spelling
|
||||
id: spelling
|
||||
uses: check-spelling/check-spelling@67debf50669c7fc76fc8f5d7f996384535a72b77 # v0.0.24
|
||||
uses: check-spelling/check-spelling@c635c2f3f714eec2fcf27b643a1919b9a811ef2e # v0.0.25
|
||||
with:
|
||||
config: .github/actions/spell-check
|
||||
suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }}
|
||||
@@ -156,7 +156,7 @@ jobs:
|
||||
if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push'
|
||||
steps:
|
||||
- name: comment
|
||||
uses: check-spelling/check-spelling@67debf50669c7fc76fc8f5d7f996384535a72b77 # v0.0.24
|
||||
uses: check-spelling/check-spelling@c635c2f3f714eec2fcf27b643a1919b9a811ef2e # v0.0.25
|
||||
with:
|
||||
config: .github/actions/spell-check
|
||||
checkout: true
|
||||
@@ -175,7 +175,7 @@ jobs:
|
||||
if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request')
|
||||
steps:
|
||||
- name: comment
|
||||
uses: check-spelling/check-spelling@67debf50669c7fc76fc8f5d7f996384535a72b77 # v0.0.24
|
||||
uses: check-spelling/check-spelling@c635c2f3f714eec2fcf27b643a1919b9a811ef2e # v0.0.25
|
||||
with:
|
||||
config: .github/actions/spell-check
|
||||
checkout: true
|
||||
@@ -202,7 +202,7 @@ jobs:
|
||||
cancel-in-progress: false
|
||||
steps:
|
||||
- name: apply spelling updates
|
||||
uses: check-spelling/check-spelling@67debf50669c7fc76fc8f5d7f996384535a72b77 # v0.0.24
|
||||
uses: check-spelling/check-spelling@c635c2f3f714eec2fcf27b643a1919b9a811ef2e # v0.0.25
|
||||
with:
|
||||
experimental_apply_changes_via_bot: ${{ github.repository_owner != 'microsoft' && 1 }}
|
||||
checkout: true
|
||||
|
||||
@@ -3,227 +3,227 @@
|
||||
"UseMinimatch": false,
|
||||
"SignBatches": [
|
||||
{
|
||||
"MatchedPath": [
|
||||
"*.resources.dll",
|
||||
|
||||
"WinUI3Apps\\Assets\\Settings\\Scripts\\*.ps1",
|
||||
"MatchedPath": [
|
||||
"*.resources.dll",
|
||||
|
||||
"PowerToys.ActionRunner.exe",
|
||||
"PowerToys.Update.exe",
|
||||
"PowerToys.BackgroundActivatorDLL.dll",
|
||||
"Notifications.dll",
|
||||
"os-detection.dll",
|
||||
"PowerToys.exe",
|
||||
"PowerToys.FilePreviewCommon.dll",
|
||||
"PowerToys.Interop.dll",
|
||||
"Tools\\PowerToys.BugReportTool.exe",
|
||||
"StylesReportTool\\PowerToys.StylesReportTool.exe",
|
||||
"Telemetry.dll",
|
||||
"PowerToys.ManagedTelemetry.dll",
|
||||
"PowerToys.ManagedCommon.dll",
|
||||
"PowerToys.Common.UI.dll",
|
||||
"PowerToys.Settings.UI.Lib.dll",
|
||||
"PowerToys.GPOWrapper.dll",
|
||||
"PowerToys.GPOWrapperProjection.dll",
|
||||
"PowerToys.AllExperiments.dll",
|
||||
"WinUI3Apps\\Assets\\Settings\\Scripts\\*.ps1",
|
||||
|
||||
"PowerToys.AlwaysOnTop.exe",
|
||||
"PowerToys.AlwaysOnTopModuleInterface.dll",
|
||||
"PowerToys.ActionRunner.exe",
|
||||
"PowerToys.Update.exe",
|
||||
"PowerToys.BackgroundActivatorDLL.dll",
|
||||
"Notifications.dll",
|
||||
"os-detection.dll",
|
||||
"PowerToys.exe",
|
||||
"PowerToys.FilePreviewCommon.dll",
|
||||
"PowerToys.Interop.dll",
|
||||
"Tools\\PowerToys.BugReportTool.exe",
|
||||
"StylesReportTool\\PowerToys.StylesReportTool.exe",
|
||||
"Telemetry.dll",
|
||||
"CalculatorEngineCommon.dll",
|
||||
"PowerToys.ManagedTelemetry.dll",
|
||||
"PowerToys.ManagedCommon.dll",
|
||||
"PowerToys.Common.UI.dll",
|
||||
"PowerToys.Settings.UI.Lib.dll",
|
||||
"PowerToys.GPOWrapper.dll",
|
||||
"PowerToys.GPOWrapperProjection.dll",
|
||||
"PowerToys.AllExperiments.dll",
|
||||
|
||||
"PowerToys.CmdNotFoundModuleInterface.dll",
|
||||
"PowerToys.CmdNotFound.dll",
|
||||
"PowerToys.AlwaysOnTop.exe",
|
||||
"PowerToys.AlwaysOnTopModuleInterface.dll",
|
||||
|
||||
"PowerToys.ColorPicker.dll",
|
||||
"PowerToys.ColorPickerUI.dll",
|
||||
"PowerToys.ColorPickerUI.exe",
|
||||
"PowerToys.CmdNotFoundModuleInterface.dll",
|
||||
"PowerToys.CmdNotFound.dll",
|
||||
|
||||
"PowerToys.CropAndLockModuleInterface.dll",
|
||||
"PowerToys.CropAndLock.exe",
|
||||
"PowerToys.ColorPicker.dll",
|
||||
"PowerToys.ColorPickerUI.dll",
|
||||
"PowerToys.ColorPickerUI.exe",
|
||||
|
||||
"PowerToys.PowerOCRModuleInterface.dll",
|
||||
"PowerToys.PowerOCR.dll",
|
||||
"PowerToys.PowerOCR.exe",
|
||||
"PowerToys.CropAndLockModuleInterface.dll",
|
||||
"PowerToys.CropAndLock.exe",
|
||||
|
||||
"PowerToys.AdvancedPasteModuleInterface.dll",
|
||||
"WinUI3Apps\\PowerToys.AdvancedPaste.exe",
|
||||
"WinUI3Apps\\PowerToys.AdvancedPaste.dll",
|
||||
"PowerToys.PowerOCRModuleInterface.dll",
|
||||
"PowerToys.PowerOCR.dll",
|
||||
"PowerToys.PowerOCR.exe",
|
||||
|
||||
"PowerToys.AwakeModuleInterface.dll",
|
||||
"PowerToys.Awake.exe",
|
||||
"PowerToys.Awake.dll",
|
||||
"PowerToys.AdvancedPasteModuleInterface.dll",
|
||||
"WinUI3Apps\\PowerToys.AdvancedPaste.exe",
|
||||
"WinUI3Apps\\PowerToys.AdvancedPaste.dll",
|
||||
|
||||
"fancyzones.dll",
|
||||
"PowerToys.FancyZonesEditor.exe",
|
||||
"PowerToys.FancyZonesEditor.dll",
|
||||
"PowerToys.FancyZonesEditorCommon.dll",
|
||||
"PowerToys.FancyZonesModuleInterface.dll",
|
||||
"PowerToys.FancyZones.exe",
|
||||
"PowerToys.AwakeModuleInterface.dll",
|
||||
"PowerToys.Awake.exe",
|
||||
"PowerToys.Awake.dll",
|
||||
|
||||
"PowerToys.GcodePreviewHandler.dll",
|
||||
"PowerToys.GcodePreviewHandler.exe",
|
||||
"PowerToys.GcodePreviewHandlerCpp.dll",
|
||||
"PowerToys.GcodeThumbnailProvider.dll",
|
||||
"PowerToys.GcodeThumbnailProvider.exe",
|
||||
"PowerToys.GcodeThumbnailProviderCpp.dll",
|
||||
"PowerToys.ManagedTelemetry.dll",
|
||||
"PowerToys.MarkdownPreviewHandler.dll",
|
||||
"PowerToys.MarkdownPreviewHandler.exe",
|
||||
"PowerToys.MarkdownPreviewHandlerCpp.dll",
|
||||
"PowerToys.MonacoPreviewHandler.dll",
|
||||
"PowerToys.MonacoPreviewHandler.exe",
|
||||
"PowerToys.MonacoPreviewHandlerCpp.dll",
|
||||
"PowerToys.PdfPreviewHandler.dll",
|
||||
"PowerToys.PdfPreviewHandler.exe",
|
||||
"PowerToys.PdfPreviewHandlerCpp.dll",
|
||||
"PowerToys.PdfThumbnailProvider.dll",
|
||||
"PowerToys.PdfThumbnailProvider.exe",
|
||||
"PowerToys.PdfThumbnailProviderCpp.dll",
|
||||
"PowerToys.powerpreview.dll",
|
||||
"PowerToys.PreviewHandlerCommon.dll",
|
||||
"PowerToys.QoiPreviewHandler.dll",
|
||||
"PowerToys.QoiPreviewHandler.exe",
|
||||
"PowerToys.QoiPreviewHandlerCpp.dll",
|
||||
"PowerToys.QoiThumbnailProvider.dll",
|
||||
"PowerToys.QoiThumbnailProvider.exe",
|
||||
"PowerToys.QoiThumbnailProviderCpp.dll",
|
||||
"PowerToys.StlThumbnailProvider.dll",
|
||||
"PowerToys.StlThumbnailProvider.exe",
|
||||
"PowerToys.StlThumbnailProviderCpp.dll",
|
||||
"PowerToys.SvgPreviewHandler.dll",
|
||||
"PowerToys.SvgPreviewHandler.exe",
|
||||
"PowerToys.SvgPreviewHandlerCpp.dll",
|
||||
"PowerToys.SvgThumbnailProvider.dll",
|
||||
"PowerToys.SvgThumbnailProvider.exe",
|
||||
"PowerToys.SvgThumbnailProviderCpp.dll",
|
||||
"fancyzones.dll",
|
||||
"PowerToys.FancyZonesEditor.exe",
|
||||
"PowerToys.FancyZonesEditor.dll",
|
||||
"PowerToys.FancyZonesEditorCommon.dll",
|
||||
"PowerToys.FancyZonesModuleInterface.dll",
|
||||
"PowerToys.FancyZones.exe",
|
||||
|
||||
"WinUI3Apps\\PowerToys.HostsModuleInterface.dll",
|
||||
"WinUI3Apps\\PowerToys.HostsUILib.dll",
|
||||
"WinUI3Apps\\PowerToys.Hosts.dll",
|
||||
"WinUI3Apps\\PowerToys.Hosts.exe",
|
||||
"PowerToys.GcodePreviewHandler.dll",
|
||||
"PowerToys.GcodePreviewHandler.exe",
|
||||
"PowerToys.GcodePreviewHandlerCpp.dll",
|
||||
"PowerToys.GcodeThumbnailProvider.dll",
|
||||
"PowerToys.GcodeThumbnailProvider.exe",
|
||||
"PowerToys.GcodeThumbnailProviderCpp.dll",
|
||||
"PowerToys.ManagedTelemetry.dll",
|
||||
"PowerToys.MarkdownPreviewHandler.dll",
|
||||
"PowerToys.MarkdownPreviewHandler.exe",
|
||||
"PowerToys.MarkdownPreviewHandlerCpp.dll",
|
||||
"PowerToys.MonacoPreviewHandler.dll",
|
||||
"PowerToys.MonacoPreviewHandler.exe",
|
||||
"PowerToys.MonacoPreviewHandlerCpp.dll",
|
||||
"PowerToys.PdfPreviewHandler.dll",
|
||||
"PowerToys.PdfPreviewHandler.exe",
|
||||
"PowerToys.PdfPreviewHandlerCpp.dll",
|
||||
"PowerToys.PdfThumbnailProvider.dll",
|
||||
"PowerToys.PdfThumbnailProvider.exe",
|
||||
"PowerToys.PdfThumbnailProviderCpp.dll",
|
||||
"PowerToys.powerpreview.dll",
|
||||
"PowerToys.PreviewHandlerCommon.dll",
|
||||
"PowerToys.QoiPreviewHandler.dll",
|
||||
"PowerToys.QoiPreviewHandler.exe",
|
||||
"PowerToys.QoiPreviewHandlerCpp.dll",
|
||||
"PowerToys.QoiThumbnailProvider.dll",
|
||||
"PowerToys.QoiThumbnailProvider.exe",
|
||||
"PowerToys.QoiThumbnailProviderCpp.dll",
|
||||
"PowerToys.StlThumbnailProvider.dll",
|
||||
"PowerToys.StlThumbnailProvider.exe",
|
||||
"PowerToys.StlThumbnailProviderCpp.dll",
|
||||
"PowerToys.SvgPreviewHandler.dll",
|
||||
"PowerToys.SvgPreviewHandler.exe",
|
||||
"PowerToys.SvgPreviewHandlerCpp.dll",
|
||||
"PowerToys.SvgThumbnailProvider.dll",
|
||||
"PowerToys.SvgThumbnailProvider.exe",
|
||||
"PowerToys.SvgThumbnailProviderCpp.dll",
|
||||
|
||||
"WinUI3Apps\\PowerToys.FileLocksmithLib.Interop.dll",
|
||||
"WinUI3Apps\\PowerToys.FileLocksmithExt.dll",
|
||||
"WinUI3Apps\\PowerToys.FileLocksmithUI.exe",
|
||||
"WinUI3Apps\\PowerToys.FileLocksmithUI.dll",
|
||||
"WinUI3Apps\\PowerToys.FileLocksmithContextMenu.dll",
|
||||
"FileLocksmithContextMenuPackage.msix",
|
||||
"WinUI3Apps\\PowerToys.HostsModuleInterface.dll",
|
||||
"WinUI3Apps\\PowerToys.HostsUILib.dll",
|
||||
"WinUI3Apps\\PowerToys.Hosts.dll",
|
||||
"WinUI3Apps\\PowerToys.Hosts.exe",
|
||||
|
||||
"WinUI3Apps\\Peek.Common.dll",
|
||||
"WinUI3Apps\\Peek.FilePreviewer.dll",
|
||||
"WinUI3Apps\\Powertoys.Peek.UI.dll",
|
||||
"WinUI3Apps\\Powertoys.Peek.UI.exe",
|
||||
"WinUI3Apps\\Powertoys.Peek.dll",
|
||||
"WinUI3Apps\\PowerToys.FileLocksmithLib.Interop.dll",
|
||||
"WinUI3Apps\\PowerToys.FileLocksmithExt.dll",
|
||||
"WinUI3Apps\\PowerToys.FileLocksmithUI.exe",
|
||||
"WinUI3Apps\\PowerToys.FileLocksmithUI.dll",
|
||||
"WinUI3Apps\\PowerToys.FileLocksmithContextMenu.dll",
|
||||
"FileLocksmithContextMenuPackage.msix",
|
||||
|
||||
"WinUI3Apps\\PowerToys.EnvironmentVariablesModuleInterface.dll",
|
||||
"WinUI3Apps\\PowerToys.EnvironmentVariablesUILib.dll",
|
||||
"WinUI3Apps\\PowerToys.EnvironmentVariables.dll",
|
||||
"WinUI3Apps\\PowerToys.EnvironmentVariables.exe",
|
||||
"WinUI3Apps\\Peek.Common.dll",
|
||||
"WinUI3Apps\\Peek.FilePreviewer.dll",
|
||||
"WinUI3Apps\\Powertoys.Peek.UI.dll",
|
||||
"WinUI3Apps\\Powertoys.Peek.UI.exe",
|
||||
"WinUI3Apps\\Powertoys.Peek.dll",
|
||||
|
||||
"PowerToys.ImageResizer.exe",
|
||||
"PowerToys.ImageResizer.dll",
|
||||
"PowerToys.ImageResizerExt.dll",
|
||||
"PowerToys.ImageResizerContextMenu.dll",
|
||||
"ImageResizerContextMenuPackage.msix",
|
||||
"WinUI3Apps\\PowerToys.EnvironmentVariablesModuleInterface.dll",
|
||||
"WinUI3Apps\\PowerToys.EnvironmentVariablesUILib.dll",
|
||||
"WinUI3Apps\\PowerToys.EnvironmentVariables.dll",
|
||||
"WinUI3Apps\\PowerToys.EnvironmentVariables.exe",
|
||||
|
||||
"PowerToys.KeyboardManager.dll",
|
||||
"KeyboardManagerEditor\\PowerToys.KeyboardManagerEditor.exe",
|
||||
"KeyboardManagerEngine\\PowerToys.KeyboardManagerEngine.exe",
|
||||
"PowerToys.KeyboardManagerEditorLibraryWrapper.dll",
|
||||
"PowerToys.ImageResizer.exe",
|
||||
"PowerToys.ImageResizer.dll",
|
||||
"PowerToys.ImageResizerExt.dll",
|
||||
"PowerToys.ImageResizerContextMenu.dll",
|
||||
"ImageResizerContextMenuPackage.msix",
|
||||
|
||||
"PowerToys.Launcher.dll",
|
||||
"PowerToys.PowerLauncher.dll",
|
||||
"PowerToys.PowerLauncher.exe",
|
||||
"PowerToys.PowerLauncher.Telemetry.dll",
|
||||
"Wox.dll",
|
||||
"Wox.Infrastructure.dll",
|
||||
"Wox.Plugin.dll",
|
||||
"RunPlugins\\Calculator\\Microsoft.PowerToys.Run.Plugin.Calculator.dll",
|
||||
"RunPlugins\\Folder\\Microsoft.Plugin.Folder.dll",
|
||||
"RunPlugins\\Indexer\\Microsoft.Plugin.Indexer.dll",
|
||||
"RunPlugins\\OneNote\\Microsoft.PowerToys.Run.Plugin.OneNote.dll",
|
||||
"RunPlugins\\History\\Microsoft.PowerToys.Run.Plugin.History.dll",
|
||||
"RunPlugins\\PowerToys\\Microsoft.PowerToys.Run.Plugin.PowerToys.dll",
|
||||
"RunPlugins\\Program\\Microsoft.Plugin.Program.dll",
|
||||
"RunPlugins\\Registry\\Microsoft.PowerToys.Run.Plugin.Registry.dll",
|
||||
"RunPlugins\\WindowsSettings\\Microsoft.PowerToys.Run.Plugin.WindowsSettings.dll",
|
||||
"RunPlugins\\Shell\\Microsoft.Plugin.Shell.dll",
|
||||
"RunPlugins\\Uri\\Microsoft.Plugin.Uri.dll",
|
||||
"RunPlugins\\WindowWalker\\Microsoft.Plugin.WindowWalker.dll",
|
||||
"RunPlugins\\UnitConverter\\Community.PowerToys.Run.Plugin.UnitConverter.dll",
|
||||
"RunPlugins\\VSCodeWorkspaces\\Community.PowerToys.Run.Plugin.VSCodeWorkspaces.dll",
|
||||
"RunPlugins\\Service\\Microsoft.PowerToys.Run.Plugin.Service.dll",
|
||||
"RunPlugins\\System\\Microsoft.PowerToys.Run.Plugin.System.dll",
|
||||
"RunPlugins\\TimeDate\\Microsoft.PowerToys.Run.Plugin.TimeDate.dll",
|
||||
"RunPlugins\\ValueGenerator\\Community.PowerToys.Run.Plugin.ValueGenerator.dll",
|
||||
"RunPlugins\\WebSearch\\Community.PowerToys.Run.Plugin.WebSearch.dll",
|
||||
"RunPlugins\\WindowsTerminal\\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.dll",
|
||||
|
||||
"WinUI3Apps\\PowerToys.MeasureToolModuleInterface.dll",
|
||||
"WinUI3Apps\\PowerToys.MeasureToolCore.dll",
|
||||
"WinUI3Apps\\PowerToys.MeasureToolUI.dll",
|
||||
"WinUI3Apps\\PowerToys.MeasureToolUI.exe",
|
||||
"PowerToys.KeyboardManager.dll",
|
||||
"KeyboardManagerEditor\\PowerToys.KeyboardManagerEditor.exe",
|
||||
"KeyboardManagerEngine\\PowerToys.KeyboardManagerEngine.exe",
|
||||
"PowerToys.KeyboardManagerEditorLibraryWrapper.dll",
|
||||
|
||||
"PowerToys.FindMyMouse.dll",
|
||||
"PowerToys.MouseHighlighter.dll",
|
||||
"PowerToys.MouseJump.dll",
|
||||
"PowerToys.MouseJump.Common.dll",
|
||||
"PowerToys.MousePointerCrosshairs.dll",
|
||||
"PowerToys.MouseJumpUI.dll",
|
||||
"PowerToys.MouseJumpUI.exe",
|
||||
"PowerToys.Launcher.dll",
|
||||
"PowerToys.PowerLauncher.dll",
|
||||
"PowerToys.PowerLauncher.exe",
|
||||
"PowerToys.PowerLauncher.Telemetry.dll",
|
||||
"Wox.dll",
|
||||
"Wox.Infrastructure.dll",
|
||||
"Wox.Plugin.dll",
|
||||
"RunPlugins\\Calculator\\Microsoft.PowerToys.Run.Plugin.Calculator.dll",
|
||||
"RunPlugins\\Folder\\Microsoft.Plugin.Folder.dll",
|
||||
"RunPlugins\\Indexer\\Microsoft.Plugin.Indexer.dll",
|
||||
"RunPlugins\\OneNote\\Microsoft.PowerToys.Run.Plugin.OneNote.dll",
|
||||
"RunPlugins\\History\\Microsoft.PowerToys.Run.Plugin.History.dll",
|
||||
"RunPlugins\\PowerToys\\Microsoft.PowerToys.Run.Plugin.PowerToys.dll",
|
||||
"RunPlugins\\Program\\Microsoft.Plugin.Program.dll",
|
||||
"RunPlugins\\Registry\\Microsoft.PowerToys.Run.Plugin.Registry.dll",
|
||||
"RunPlugins\\WindowsSettings\\Microsoft.PowerToys.Run.Plugin.WindowsSettings.dll",
|
||||
"RunPlugins\\Shell\\Microsoft.Plugin.Shell.dll",
|
||||
"RunPlugins\\Uri\\Microsoft.Plugin.Uri.dll",
|
||||
"RunPlugins\\WindowWalker\\Microsoft.Plugin.WindowWalker.dll",
|
||||
"RunPlugins\\UnitConverter\\Community.PowerToys.Run.Plugin.UnitConverter.dll",
|
||||
"RunPlugins\\VSCodeWorkspaces\\Community.PowerToys.Run.Plugin.VSCodeWorkspaces.dll",
|
||||
"RunPlugins\\Service\\Microsoft.PowerToys.Run.Plugin.Service.dll",
|
||||
"RunPlugins\\System\\Microsoft.PowerToys.Run.Plugin.System.dll",
|
||||
"RunPlugins\\TimeDate\\Microsoft.PowerToys.Run.Plugin.TimeDate.dll",
|
||||
"RunPlugins\\ValueGenerator\\Community.PowerToys.Run.Plugin.ValueGenerator.dll",
|
||||
"RunPlugins\\WebSearch\\Community.PowerToys.Run.Plugin.WebSearch.dll",
|
||||
"RunPlugins\\WindowsTerminal\\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.dll",
|
||||
|
||||
"PowerToys.MouseWithoutBorders.dll",
|
||||
"PowerToys.MouseWithoutBorders.exe",
|
||||
"PowerToys.MouseWithoutBordersModuleInterface.dll",
|
||||
"PowerToys.MouseWithoutBordersService.dll",
|
||||
"PowerToys.MouseWithoutBordersService.exe",
|
||||
"PowerToys.MouseWithoutBordersHelper.dll",
|
||||
"PowerToys.MouseWithoutBordersHelper.exe",
|
||||
"WinUI3Apps\\PowerToys.MeasureToolModuleInterface.dll",
|
||||
"WinUI3Apps\\PowerToys.MeasureToolCore.dll",
|
||||
"WinUI3Apps\\PowerToys.MeasureToolUI.dll",
|
||||
"WinUI3Apps\\PowerToys.MeasureToolUI.exe",
|
||||
|
||||
"WinUI3Apps\\PowerToys.NewPlus.ShellExtension.dll",
|
||||
"WinUI3Apps\\NewPlusPackage.msix",
|
||||
"WinUI3Apps\\PowerToys.NewPlus.ShellExtension.win10.dll",
|
||||
"PowerToys.FindMyMouse.dll",
|
||||
"PowerToys.MouseHighlighter.dll",
|
||||
"PowerToys.MouseJump.dll",
|
||||
"PowerToys.MouseJump.Common.dll",
|
||||
"PowerToys.MousePointerCrosshairs.dll",
|
||||
"PowerToys.MouseJumpUI.dll",
|
||||
"PowerToys.MouseJumpUI.exe",
|
||||
|
||||
"PowerAccent.Core.dll",
|
||||
"PowerToys.PowerAccent.dll",
|
||||
"PowerToys.PowerAccent.exe",
|
||||
"PowerToys.PowerAccentModuleInterface.dll",
|
||||
"PowerToys.PowerAccentKeyboardService.dll",
|
||||
"PowerToys.MouseWithoutBorders.dll",
|
||||
"PowerToys.MouseWithoutBorders.exe",
|
||||
"PowerToys.MouseWithoutBordersModuleInterface.dll",
|
||||
"PowerToys.MouseWithoutBordersService.dll",
|
||||
"PowerToys.MouseWithoutBordersService.exe",
|
||||
"PowerToys.MouseWithoutBordersHelper.dll",
|
||||
"PowerToys.MouseWithoutBordersHelper.exe",
|
||||
|
||||
"WinUI3Apps\\PowerToys.PowerRenameExt.dll",
|
||||
"WinUI3Apps\\PowerToys.PowerRename.exe",
|
||||
"WinUI3Apps\\PowerToys.PowerRenameContextMenu.dll",
|
||||
"WinUI3Apps\\PowerRenameContextMenuPackage.msix",
|
||||
"WinUI3Apps\\PowerToys.NewPlus.ShellExtension.dll",
|
||||
"WinUI3Apps\\NewPlusPackage.msix",
|
||||
"WinUI3Apps\\PowerToys.NewPlus.ShellExtension.win10.dll",
|
||||
|
||||
"PowerToys.WorkspacesSnapshotTool.exe",
|
||||
"PowerToys.WorkspacesLauncher.exe",
|
||||
"PowerToys.WorkspacesWindowArranger.exe",
|
||||
"PowerToys.WorkspacesEditor.exe",
|
||||
"PowerToys.WorkspacesEditor.dll",
|
||||
"PowerToys.WorkspacesLauncherUI.exe",
|
||||
"PowerToys.WorkspacesLauncherUI.dll",
|
||||
"PowerToys.WorkspacesModuleInterface.dll",
|
||||
"PowerToys.WorkspacesCsharpLibrary.dll",
|
||||
"PowerAccent.Core.dll",
|
||||
"PowerToys.PowerAccent.dll",
|
||||
"PowerToys.PowerAccent.exe",
|
||||
"PowerToys.PowerAccentModuleInterface.dll",
|
||||
"PowerToys.PowerAccentKeyboardService.dll",
|
||||
|
||||
"WinUI3Apps\\PowerToys.RegistryPreviewExt.dll",
|
||||
"WinUI3Apps\\PowerToys.RegistryPreviewUILib.dll",
|
||||
"WinUI3Apps\\PowerToys.RegistryPreview.dll",
|
||||
"WinUI3Apps\\PowerToys.RegistryPreview.exe",
|
||||
"WinUI3Apps\\PowerToys.PowerRenameExt.dll",
|
||||
"WinUI3Apps\\PowerToys.PowerRename.exe",
|
||||
"WinUI3Apps\\PowerToys.PowerRenameContextMenu.dll",
|
||||
"WinUI3Apps\\PowerRenameContextMenuPackage.msix",
|
||||
|
||||
"PowerToys.ShortcutGuide.exe",
|
||||
"PowerToys.ShortcutGuideModuleInterface.dll",
|
||||
"PowerToys.WorkspacesSnapshotTool.exe",
|
||||
"PowerToys.WorkspacesLauncher.exe",
|
||||
"PowerToys.WorkspacesWindowArranger.exe",
|
||||
"PowerToys.WorkspacesEditor.exe",
|
||||
"PowerToys.WorkspacesEditor.dll",
|
||||
"PowerToys.WorkspacesLauncherUI.exe",
|
||||
"PowerToys.WorkspacesLauncherUI.dll",
|
||||
"PowerToys.WorkspacesModuleInterface.dll",
|
||||
"PowerToys.WorkspacesCsharpLibrary.dll",
|
||||
|
||||
"PowerToys.ZoomIt.exe",
|
||||
"PowerToys.ZoomItModuleInterface.dll",
|
||||
"PowerToys.ZoomItSettingsInterop.dll",
|
||||
"WinUI3Apps\\PowerToys.RegistryPreviewExt.dll",
|
||||
"WinUI3Apps\\PowerToys.RegistryPreviewUILib.dll",
|
||||
"WinUI3Apps\\PowerToys.RegistryPreview.dll",
|
||||
"WinUI3Apps\\PowerToys.RegistryPreview.exe",
|
||||
|
||||
"WinUI3Apps\\PowerToys.Settings.dll",
|
||||
"WinUI3Apps\\PowerToys.Settings.exe",
|
||||
"PowerToys.ShortcutGuide.exe",
|
||||
"PowerToys.ShortcutGuideModuleInterface.dll",
|
||||
|
||||
"PowerToys.CmdPalModuleInterface.dll",
|
||||
"CmdPalKeyboardService.dll",
|
||||
"CmdPalCalculator.dll",
|
||||
"*Microsoft.CmdPal.UI_*.msix"
|
||||
],
|
||||
"PowerToys.ZoomIt.exe",
|
||||
"PowerToys.ZoomItModuleInterface.dll",
|
||||
"PowerToys.ZoomItSettingsInterop.dll",
|
||||
|
||||
"WinUI3Apps\\PowerToys.Settings.dll",
|
||||
"WinUI3Apps\\PowerToys.Settings.exe",
|
||||
|
||||
"PowerToys.CmdPalModuleInterface.dll",
|
||||
"CmdPalKeyboardService.dll",
|
||||
"*Microsoft.CmdPal.UI_*.msix"
|
||||
],
|
||||
"SigningInfo": {
|
||||
"Operations": [
|
||||
{
|
||||
|
||||
@@ -41,6 +41,9 @@ Write-Output ""
|
||||
Write-Output "Restoring dotnet tools..."
|
||||
dotnet tool restore --disable-parallel --no-cache
|
||||
|
||||
# Use Regex syntax
|
||||
$PathExcludes = "(\\obj\\)|(\\bin\\)|(\\x64\\)|(\\Generated Files\\PowerRenameXAML\\)|(\\RegistryPreviewUILib\\Controls\\HexBox\\)"
|
||||
|
||||
if (-not $Passive)
|
||||
{
|
||||
# Look for unstaged changed files by default
|
||||
@@ -87,7 +90,7 @@ if (-not $Passive)
|
||||
}
|
||||
|
||||
Write-Output "Running Git Diff: $gitDiffCommand"
|
||||
$files = Invoke-Expression $gitDiffCommand | Select-String -Pattern "\.xaml$"
|
||||
$files = Invoke-Expression $gitDiffCommand | Select-String -Pattern "\.xaml$" | Where-Object { $_ -notmatch $PathExcludes }
|
||||
|
||||
if (-not $Passive -and -not $Main -and -not $Unstaged -and -not $Staged -and -not $LastCommit)
|
||||
{
|
||||
@@ -107,7 +110,7 @@ if (-not $Passive)
|
||||
else
|
||||
{
|
||||
Write-Output "Checking all files (passively)"
|
||||
$files = Get-ChildItem -Path "$PSScriptRoot\..\src\*.xaml" -Recurse | Select-Object -ExpandProperty FullName | Where-Object { $_ -notmatch "(\\obj\\)|(\\bin\\)|(\\x64\\)|(\\Generated Files\\PowerRenameXAML\\)" }
|
||||
$files = Get-ChildItem -Path "$PSScriptRoot\..\src\*.xaml" -Recurse | Select-Object -ExpandProperty FullName | Where-Object { $_ -notmatch $PathExcludes }
|
||||
|
||||
if ($files.count -gt 0)
|
||||
{
|
||||
|
||||
@@ -397,6 +397,7 @@ jobs:
|
||||
**\UnitTests-CommonLib.dll
|
||||
**\PowerRenameUnitTests.dll
|
||||
**\UnitTests-FancyZones.dll
|
||||
**\\WorkspacesLibUnitTests.dll
|
||||
!**\obj\**
|
||||
|
||||
- pwsh: |-
|
||||
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
pwsh: true
|
||||
ScriptType: InlineScript
|
||||
Inline: |-
|
||||
$AzToken = (Get-AzAccessToken -ResourceUrl api://30471ccf-0966-45b9-a979-065dbedb24c1).Token
|
||||
$AzToken = (Get-AzAccessToken -AsSecureString -ResourceUrl api://30471ccf-0966-45b9-a979-065dbedb24c1).Token | ConvertFrom-SecureString -AsPlainText
|
||||
Write-Host "##vso[task.setvariable variable=SymbolAccessToken;issecret=true]$AzToken"
|
||||
|
||||
|
||||
|
||||
@@ -72,9 +72,57 @@ $returnList = [System.Collections.Generic.HashSet[string]]($totalList) -join "`r
|
||||
|
||||
Write-Host $returnList
|
||||
|
||||
# Extract the current package list from NOTICE.md
|
||||
$noticePattern = "## NuGet Packages used by PowerToys\s*((?:\r?\n- .+)+)"
|
||||
$noticeMatch = [regex]::Match($noticeFile, $noticePattern)
|
||||
|
||||
if ($noticeMatch.Success) {
|
||||
$currentNoticePackageList = $noticeMatch.Groups[1].Value.Trim()
|
||||
} else {
|
||||
Write-Warning "Warning: Could not find 'NuGet Packages used by PowerToys' section in NOTICE.md"
|
||||
$currentNoticePackageList = ""
|
||||
}
|
||||
|
||||
if (!$noticeFile.Trim().EndsWith($returnList.Trim()))
|
||||
{
|
||||
Write-Host -ForegroundColor Red "Notice.md does not match NuGet list."
|
||||
|
||||
# Show detailed differences
|
||||
$generatedPackages = $returnList -split "`r`n|`n" | Where-Object { $_.Trim() -ne "" } | Sort-Object
|
||||
$noticePackages = $currentNoticePackageList -split "`r`n|`n" | Where-Object { $_.Trim() -ne "" } | ForEach-Object { $_.Trim() } | Sort-Object
|
||||
|
||||
Write-Host ""
|
||||
Write-Host -ForegroundColor Cyan "=== DETAILED DIFFERENCE ANALYSIS ==="
|
||||
Write-Host ""
|
||||
|
||||
# Find packages in proj file list but not in NOTICE.md
|
||||
$missingFromNotice = $generatedPackages | Where-Object { $noticePackages -notcontains $_ }
|
||||
if ($missingFromNotice.Count -gt 0) {
|
||||
Write-Host -ForegroundColor Red "MissingFromNotice:"
|
||||
foreach ($pkg in $missingFromNotice) {
|
||||
Write-Host -ForegroundColor Red " $pkg"
|
||||
}
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
# Find packages in NOTICE.md but not in proj file list
|
||||
$extraInNotice = $noticePackages | Where-Object { $generatedPackages -notcontains $_ }
|
||||
if ($extraInNotice.Count -gt 0) {
|
||||
Write-Host -ForegroundColor Yellow "ExtraInNotice:"
|
||||
foreach ($pkg in $extraInNotice) {
|
||||
Write-Host -ForegroundColor Yellow " $pkg"
|
||||
}
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
# Show counts for summary
|
||||
Write-Host -ForegroundColor Cyan "Summary:"
|
||||
Write-Host " Proj file list has $($generatedPackages.Count) packages"
|
||||
Write-Host " NOTICE.md has $($noticePackages.Count) packages"
|
||||
Write-Host " MissingFromNotice: $($missingFromNotice.Count) packages"
|
||||
Write-Host " ExtraInNotice: $($extraInNotice.Count) packages"
|
||||
Write-Host ""
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ Connor was the creator of Workspaces and helped create Command Palette (PowerToy
|
||||
### [@damienleroy](https://github.com/damienleroy) - [Damien Leroy](https://www.linkedin.com/in/Damien-Leroy-b2734416a/)
|
||||
Damien has helped out by developing and contributing the Quick Accent utility.
|
||||
|
||||
### [@daverayment ](https://github.com/daverayment) - [David Rayment](https://www.linkedin.com/in/david-rayment-168b5251/)
|
||||
### [@daverayment](https://github.com/daverayment) - [David Rayment](https://www.linkedin.com/in/david-rayment-168b5251/)
|
||||
Dave has helped improve the experience inside of Peek by adding in new features and fixing bugs.
|
||||
|
||||
### [@davidegiacometti](https://github.com/davidegiacometti) - [Davide Giacometti](https://www.linkedin.com/in/davidegiacometti/)
|
||||
@@ -184,7 +184,6 @@ ZoomIt source code was originally implemented by [Sysinternals](https://sysinter
|
||||
- [@nguyen-dows](https://github.com/nguyen-dows) - Christopher Nguyen - Product Manager
|
||||
- [@craigloewen-msft](https://github.com/craigloewen-msft) - Craig Loewen - Product Manager
|
||||
- [@niels9001](https://github.com/niels9001/) - Niels Laute - Product Manager
|
||||
- [@zhiwei-ms](https://github.com/zhiwei-ms) - Zhiwei Yu - Product Manager
|
||||
- [@dhowett](https://github.com/dhowett) - Dustin Howett - Dev lead
|
||||
- [@yeelam-gordon](https://github.com/yeelam-gordon) - Gordon Lam - Dev lead
|
||||
- [@jamrobot](https://github.com/jamrobot) - Jerry Xu - Dev lead
|
||||
@@ -205,6 +204,7 @@ ZoomIt source code was originally implemented by [Sysinternals](https://sysinter
|
||||
- [@chatasweetie](https://github.com/chatasweetie) - Jessica Earley-Cha - Dev
|
||||
- [@MichaelJolley](https://github.com/MichaelJolley) - Michael Jolley - Dev
|
||||
- [@Jaylyn-Barbee](https://github.com/Jaylyn-Barbee) - Jaylyn Barbee - Dev
|
||||
- [@zateutsch](https://github.com/zateutsch) - Zach Teutsch - Dev
|
||||
- [@crutkas](https://github.com/crutkas/) - Clint Rutkas - Overhead
|
||||
|
||||
## Former PowerToys core team members
|
||||
|
||||
@@ -31,22 +31,22 @@
|
||||
<!-- Including MessagePack to force version, since it's used by StreamJsonRpc but contains vulnerabilities. After StreamJsonRpc updates the version of MessagePack, we can upgrade StreamJsonRpc instead. -->
|
||||
<PackageVersion Include="MessagePack" Version="3.1.3" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" />
|
||||
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.5" />
|
||||
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.6" />
|
||||
<!-- Including Microsoft.Bcl.AsyncInterfaces to force version, since it's used by Microsoft.SemanticKernel. -->
|
||||
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.5" />
|
||||
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.16" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.5" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.5" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.5" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.5" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.15.0" />
|
||||
<PackageVersion Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
|
||||
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />
|
||||
<!-- Package Microsoft.Win32.SystemEvents added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Drawing.Common but the 8.0.1 version wasn't published to nuget. -->
|
||||
<PackageVersion Include="Microsoft.Win32.SystemEvents" Version="9.0.5" />
|
||||
<PackageVersion Include="Microsoft.Win32.SystemEvents" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.WindowsPackageManager.ComInterop" Version="1.10.340" />
|
||||
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="9.0.5" />
|
||||
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.2.46-beta" />
|
||||
<!-- CsWinRT version needs to be set to have a WinRT.Runtime.dll at the same version contained inside the NET SDK we're currently building on CI. -->
|
||||
<!--
|
||||
@@ -69,31 +69,33 @@
|
||||
<PackageVersion Include="ReverseMarkdown" Version="4.1.0" />
|
||||
<PackageVersion Include="ScipBe.Common.Office.OneNote" Version="3.0.1" />
|
||||
<PackageVersion Include="SharpCompress" Version="0.37.2" />
|
||||
<!-- Don't update SkiaSharp.Views.WinUI to version 3.* branch as this brakes the HexBox control in Registry Preview. -->
|
||||
<PackageVersion Include="SkiaSharp.Views.WinUI" Version="2.88.9" />
|
||||
<PackageVersion Include="StreamJsonRpc" Version="2.21.69" />
|
||||
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
|
||||
<!-- Package System.CodeDom added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Management but the 8.0.1 version wasn't published to nuget. -->
|
||||
<PackageVersion Include="System.CodeDom" Version="9.0.5" />
|
||||
<PackageVersion Include="System.CodeDom" Version="9.0.6" />
|
||||
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
|
||||
<PackageVersion Include="System.ComponentModel.Composition" Version="9.0.5" />
|
||||
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.5" />
|
||||
<PackageVersion Include="System.Data.OleDb" Version="9.0.5" />
|
||||
<PackageVersion Include="System.ComponentModel.Composition" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Data.OleDb" Version="9.0.6" />
|
||||
<!-- Package System.Data.SqlClient added to force it as a dependency of Microsoft.Windows.Compatibility to the latest version available at this time. -->
|
||||
<PackageVersion Include="System.Data.SqlClient" Version="4.8.6" />
|
||||
<PackageVersion Include="System.Data.SqlClient" Version="4.9.0" />
|
||||
<!-- Package System.Diagnostics.EventLog added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Data.OleDb but the 8.0.1 version wasn't published to nuget. -->
|
||||
<PackageVersion Include="System.Diagnostics.EventLog" Version="9.0.5" />
|
||||
<PackageVersion Include="System.Diagnostics.EventLog" Version="9.0.6" />
|
||||
<!-- Package System.Diagnostics.PerformanceCounter added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.11. -->
|
||||
<PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="9.0.5" />
|
||||
<PackageVersion Include="System.Drawing.Common" Version="9.0.5" />
|
||||
<PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Drawing.Common" Version="9.0.6" />
|
||||
<PackageVersion Include="System.IO.Abstractions" Version="22.0.13" />
|
||||
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="22.0.13" />
|
||||
<PackageVersion Include="System.Management" Version="9.0.5" />
|
||||
<PackageVersion Include="System.Management" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
|
||||
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
|
||||
<PackageVersion Include="System.Reactive" Version="6.0.1" />
|
||||
<PackageVersion Include="System.Runtime.Caching" Version="9.0.5" />
|
||||
<PackageVersion Include="System.ServiceProcess.ServiceController" Version="9.0.5" />
|
||||
<PackageVersion Include="System.Text.Encoding.CodePages" Version="9.0.5" />
|
||||
<PackageVersion Include="System.Text.Json" Version="9.0.5" />
|
||||
<PackageVersion Include="System.Runtime.Caching" Version="9.0.6" />
|
||||
<PackageVersion Include="System.ServiceProcess.ServiceController" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Text.Encoding.CodePages" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Text.Json" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
|
||||
<PackageVersion Include="UnicodeInformation" Version="2.6.0" />
|
||||
<PackageVersion Include="UnitsNet" Version="5.56.0" />
|
||||
|
||||
151
NOTICE.md
151
NOTICE.md
@@ -79,6 +79,43 @@ For more information, please refer to <http://unlicense.org/>
|
||||
|
||||
### Calculator
|
||||
|
||||
#### exprtk
|
||||
|
||||
We use the exprtk library (exprtk.hpp) to evaluate mathematical expressions.
|
||||
|
||||
**Source**: [https://github.com/ArashPartow/exprtk](https://github.com/ArashPartow/exprtk)
|
||||
|
||||
```
|
||||
MIT License
|
||||
|
||||
Copyright (c) 1999-2024 Arash Partow
|
||||
|
||||
https://www.partow.net/programming/exprtk/index.html
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
```
|
||||
|
||||
## Utility: PowerToys Run Built-in Extensions
|
||||
|
||||
### Calculator
|
||||
|
||||
#### Mages
|
||||
|
||||
We use the Mages NuGet package for calculating the result of expression.
|
||||
@@ -807,30 +844,25 @@ DEALINGS IN THE SOFTWARE.
|
||||
|
||||
**Source**: https://github.com/kuba--/zip
|
||||
|
||||
This is free and unencumbered software released into the public domain.
|
||||
All Rights Reserved.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <http://unlicense.org/>
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
## Utility: Measure tool
|
||||
|
||||
@@ -1395,6 +1427,37 @@ EXHIBIT A -Mozilla Public License.
|
||||
|
||||
## Utility: Registry Preview
|
||||
|
||||
### HexBox.WinUI
|
||||
|
||||
We use HexBox.WinUI to show a preview of binary values.
|
||||
|
||||
**Source**: https://github.com/hotkidfamily/HexBox.WinUI
|
||||
|
||||
```
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Filip Jeremic
|
||||
Copyright (c) 2024~2025 hotkidfamily@gmail.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
```
|
||||
|
||||
### Monaco Editor
|
||||
|
||||
**Source**: https://github.com/Microsoft/monaco-editor
|
||||
@@ -1425,6 +1488,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
```
|
||||
|
||||
|
||||
## NuGet Packages used by PowerToys
|
||||
|
||||
- AdaptiveCards.ObjectModel.WinUI3 2.0.0-beta
|
||||
@@ -1453,22 +1517,22 @@ SOFTWARE.
|
||||
- Mages 3.0.0
|
||||
- Markdig.Signed 0.34.0
|
||||
- MessagePack 3.1.3
|
||||
- Microsoft.Bcl.AsyncInterfaces 9.0.5
|
||||
- Microsoft.Bcl.AsyncInterfaces 9.0.6
|
||||
- Microsoft.CodeAnalysis.NetAnalyzers 9.0.0
|
||||
- Microsoft.Data.Sqlite 9.0.5
|
||||
- Microsoft.Data.Sqlite 9.0.6
|
||||
- Microsoft.Diagnostics.Tracing.TraceEvent 3.1.16
|
||||
- Microsoft.DotNet.ILCompiler (A)
|
||||
- Microsoft.Extensions.DependencyInjection 9.0.5
|
||||
- Microsoft.Extensions.Hosting 9.0.5
|
||||
- Microsoft.Extensions.Hosting.WindowsServices 9.0.5
|
||||
- Microsoft.Extensions.Logging 9.0.5
|
||||
- Microsoft.Extensions.Logging.Abstractions 9.0.5
|
||||
- Microsoft.Extensions.DependencyInjection 9.0.6
|
||||
- Microsoft.Extensions.Hosting 9.0.6
|
||||
- Microsoft.Extensions.Hosting.WindowsServices 9.0.6
|
||||
- Microsoft.Extensions.Logging 9.0.6
|
||||
- Microsoft.Extensions.Logging.Abstractions 9.0.6
|
||||
- Microsoft.NET.ILLink.Tasks (A)
|
||||
- Microsoft.SemanticKernel 1.15.0
|
||||
- Microsoft.Toolkit.Uwp.Notifications 7.1.2
|
||||
- Microsoft.Web.WebView2 1.0.2903.40
|
||||
- Microsoft.Win32.SystemEvents 9.0.5
|
||||
- Microsoft.Windows.Compatibility 9.0.5
|
||||
- Microsoft.Win32.SystemEvents 9.0.6
|
||||
- Microsoft.Windows.Compatibility 9.0.6
|
||||
- Microsoft.Windows.CsWin32 0.2.46-beta
|
||||
- Microsoft.Windows.CsWinRT 2.2.0
|
||||
- Microsoft.Windows.SDK.BuildTools 10.0.22621.2428
|
||||
@@ -1485,27 +1549,28 @@ SOFTWARE.
|
||||
- ReverseMarkdown 4.1.0
|
||||
- ScipBe.Common.Office.OneNote 3.0.1
|
||||
- SharpCompress 0.37.2
|
||||
- SkiaSharp.Views.WinUI 2.88.9
|
||||
- StreamJsonRpc 2.21.69
|
||||
- StyleCop.Analyzers 1.2.0-beta.556
|
||||
- System.CodeDom 9.0.5
|
||||
- System.CodeDom 9.0.6
|
||||
- System.CommandLine 2.0.0-beta4.22272.1
|
||||
- System.ComponentModel.Composition 9.0.5
|
||||
- System.Configuration.ConfigurationManager 9.0.5
|
||||
- System.Data.OleDb 9.0.5
|
||||
- System.Data.SqlClient 4.8.6
|
||||
- System.Diagnostics.EventLog 9.0.5
|
||||
- System.Diagnostics.PerformanceCounter 9.0.5
|
||||
- System.Drawing.Common 9.0.5
|
||||
- System.ComponentModel.Composition 9.0.6
|
||||
- System.Configuration.ConfigurationManager 9.0.6
|
||||
- System.Data.OleDb 9.0.6
|
||||
- System.Data.SqlClient 4.9.0
|
||||
- System.Diagnostics.EventLog 9.0.6
|
||||
- System.Diagnostics.PerformanceCounter 9.0.6
|
||||
- System.Drawing.Common 9.0.6
|
||||
- System.IO.Abstractions 22.0.13
|
||||
- System.IO.Abstractions.TestingHelpers 22.0.13
|
||||
- System.Management 9.0.5
|
||||
- System.Management 9.0.6
|
||||
- System.Net.Http 4.3.4
|
||||
- System.Private.Uri 4.3.2
|
||||
- System.Reactive 6.0.1
|
||||
- System.Runtime.Caching 9.0.5
|
||||
- System.ServiceProcess.ServiceController 9.0.5
|
||||
- System.Text.Encoding.CodePages 9.0.5
|
||||
- System.Text.Json 9.0.5
|
||||
- System.Runtime.Caching 9.0.6
|
||||
- System.ServiceProcess.ServiceController 9.0.6
|
||||
- System.Text.Encoding.CodePages 9.0.6
|
||||
- System.Text.Json 9.0.6
|
||||
- System.Text.RegularExpressions 4.3.1
|
||||
- UnicodeInformation 2.6.0
|
||||
- UnitsNet 5.56.0
|
||||
|
||||
@@ -604,6 +604,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WindowProperties", "WindowP
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WorkspacesLib", "src\modules\Workspaces\WorkspacesLib\WorkspacesLib.vcxproj", "{B31FCC55-B5A4-4EA7-B414-2DCEAE6AF332}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WorkspacesLibUnitTests", "src\modules\Workspaces\WorkspacesLib.UnitTests\WorkspacesLibUnitTests.vcxproj", "{A85D4D9F-9A39-4B5D-8B5A-9F2D5C9A8B4C}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{B31FCC55-B5A4-4EA7-B414-2DCEAE6AF332} = {B31FCC55-B5A4-4EA7-B414-2DCEAE6AF332}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkspacesLauncherUI", "src\modules\Workspaces\WorkspacesLauncherUI\WorkspacesLauncherUI.csproj", "{9C53CC25-0623-4569-95BC-B05410675EE3}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WorkspacesModuleInterface", "src\modules\Workspaces\WorkspacesModuleInterface\WorkspacesModuleInterface.vcxproj", "{45285DF2-9742-4ECA-9AC9-58951FC26489}"
|
||||
@@ -712,7 +717,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmdPalKeyboardService", "sr
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerRename.FuzzingTest", "src\modules\powerrename\PowerRename.FuzzingTest\PowerRename.FuzzingTest.vcxproj", "{2694E2FB-DCD5-4BFF-A418-B6C3C7CE3B8E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmdPalCalculator", "src\modules\cmdpal\CmdPalCalculator\CmdPalCalculator.vcxproj", "{2CF78CF7-8FEB-4BE1-9591-55FA25B48FC6}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalculatorEngineCommon", "src\common\CalculatorEngineCommon\CalculatorEngineCommon.vcxproj", "{2CF78CF7-8FEB-4BE1-9591-55FA25B48FC6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -2202,6 +2207,14 @@ Global
|
||||
{B31FCC55-B5A4-4EA7-B414-2DCEAE6AF332}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{B31FCC55-B5A4-4EA7-B414-2DCEAE6AF332}.Release|x64.ActiveCfg = Release|x64
|
||||
{B31FCC55-B5A4-4EA7-B414-2DCEAE6AF332}.Release|x64.Build.0 = Release|x64
|
||||
{A85D4D9F-9A39-4B5D-8B5A-9F2D5C9A8B4C}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{A85D4D9F-9A39-4B5D-8B5A-9F2D5C9A8B4C}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{A85D4D9F-9A39-4B5D-8B5A-9F2D5C9A8B4C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A85D4D9F-9A39-4B5D-8B5A-9F2D5C9A8B4C}.Debug|x64.Build.0 = Debug|x64
|
||||
{A85D4D9F-9A39-4B5D-8B5A-9F2D5C9A8B4C}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{A85D4D9F-9A39-4B5D-8B5A-9F2D5C9A8B4C}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{A85D4D9F-9A39-4B5D-8B5A-9F2D5C9A8B4C}.Release|x64.ActiveCfg = Release|x64
|
||||
{A85D4D9F-9A39-4B5D-8B5A-9F2D5C9A8B4C}.Release|x64.Build.0 = Release|x64
|
||||
{9C53CC25-0623-4569-95BC-B05410675EE3}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{9C53CC25-0623-4569-95BC-B05410675EE3}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{9C53CC25-0623-4569-95BC-B05410675EE3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
@@ -2835,19 +2848,20 @@ Global
|
||||
{BE126CBB-AE12-406A-9837-A05ACFCA57A7} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
|
||||
{14CB58B7-D280-4A7A-95DE-4B2DF14EA000} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
|
||||
{B31FCC55-B5A4-4EA7-B414-2DCEAE6AF332} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
|
||||
{A85D4D9F-9A39-4B5D-8B5A-9F2D5C9A8B4C} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
|
||||
{9C53CC25-0623-4569-95BC-B05410675EE3} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
|
||||
{45285DF2-9742-4ECA-9AC9-58951FC26489} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
|
||||
{3D63307B-9D27-44FD-B033-B26F39245B85} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
|
||||
{367D7543-7DBA-4381-99F1-BF6142A996C4} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
|
||||
{2CAC093E-5FCF-4102-9C2C-AC7DD5D9EB96} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
|
||||
{37D07516-4185-43A4-924F-3C7A5D95ECF6} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
|
||||
{6D56B64D-FF1F-488F-AFED-9B9854A5D399} = {ECB8E0D1-7603-4E5C-AB10-D1E545E6F8E2}
|
||||
{8F021B46-362B-485C-BFBA-CCF83E820CBD} = {8F62026A-294B-41C6-8839-87463613F216}
|
||||
{66614C26-314C-4B91-9071-76133422CFEF} = {B6C42F16-73EB-477E-8B0D-4E6CF6C20AAC}
|
||||
{3846508C-77EB-4034-A702-F8BB263C4F79} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
|
||||
{ECB8E0D1-7603-4E5C-AB10-D1E545E6F8E2} = {3846508C-77EB-4034-A702-F8BB263C4F79}
|
||||
{6CE438DF-C245-4997-A360-0A0939E4BA34} = {ECB8E0D1-7603-4E5C-AB10-D1E545E6F8E2}
|
||||
{E09AA983-C755-474F-83D6-A5CDF528C070} = {ECB8E0D1-7603-4E5C-AB10-D1E545E6F8E2}
|
||||
{6D56B64D-FF1F-488F-AFED-9B9854A5D399} = {ECB8E0D1-7603-4E5C-AB10-D1E545E6F8E2}
|
||||
{92EC89E4-9972-453A-8A1A-3A9E230C146A} = {ECB8E0D1-7603-4E5C-AB10-D1E545E6F8E2}
|
||||
{51939B4F-1F62-4BFF-A6A2-C08646E5BE95} = {ECB8E0D1-7603-4E5C-AB10-D1E545E6F8E2}
|
||||
{D1160404-D3D1-497A-883A-4059C07C2273} = {ECB8E0D1-7603-4E5C-AB10-D1E545E6F8E2}
|
||||
@@ -2889,7 +2903,7 @@ Global
|
||||
{0217E86E-3476-9946-DE8E-9D200CEBD47A} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD}
|
||||
{5F63C743-F6CE-4DBA-A200-2B3F8A14E8C2} = {3846508C-77EB-4034-A702-F8BB263C4F79}
|
||||
{2694E2FB-DCD5-4BFF-A418-B6C3C7CE3B8E} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3}
|
||||
{2CF78CF7-8FEB-4BE1-9591-55FA25B48FC6} = {3846508C-77EB-4034-A702-F8BB263C4F79}
|
||||
{2CF78CF7-8FEB-4BE1-9591-55FA25B48FC6} = {1AFB6476-670D-4E80-A464-657E01DFF482}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}
|
||||
|
||||
28
README.md
28
README.md
@@ -53,10 +53,10 @@ This is our preferred method.
|
||||
|
||||
### Via Microsoft Store
|
||||
|
||||
Install from the [Microsoft Store's PowerToys page][microsoft-store-link]. You must be using the [new Microsoft Store](https://blogs.windows.com/windowsExperience/2021/06/24/building-a-new-open-microsoft-store-on-windows-11/) which is available for both Windows 11 and Windows 10.
|
||||
Install from the [Microsoft Store's PowerToys page][microsoft-store-link]. You must be using the [new Microsoft Store](https://blogs.windows.com/windowsExperience/2021/06/24/building-a-new-open-microsoft-store-on-windows-11/), which is available for both Windows 11 and Windows 10.
|
||||
|
||||
### Via WinGet
|
||||
Download PowerToys from [WinGet][winget-link]. Updating PowerToys via winget will respect current PowerToys installation scope. To install PowerToys, run the following command from the command line / PowerShell:
|
||||
Download PowerToys from [WinGet][winget-link]. Updating PowerToys via winget will respect the current PowerToys installation scope. To install PowerToys, run the following command from the command line / PowerShell:
|
||||
|
||||
#### User scope installer [default]
|
||||
```powershell
|
||||
@@ -79,7 +79,7 @@ There is a collection of [third-party plugins](./doc/thirdPartyRunPlugins.md) cr
|
||||
|
||||
## Contributing
|
||||
|
||||
This project welcomes contributions of all types. Besides coding features / bug fixes, other ways to assist include spec writing, design, documentation, and finding bugs. We are excited to work with the power user community to build a set of tools for helping you get the most out of Windows.
|
||||
This project welcomes contributions of all types. Besides coding features / bug fixes, other ways to assist include spec writing, design, documentation, and finding bugs. We are excited to work with the power user community to build a set of tools for helping you get the most out of Windows.
|
||||
|
||||
We ask that **before you start work on a feature that you would like to contribute**, please read our [Contributor's Guide](CONTRIBUTING.md). We would be happy to work with you to figure out the best approach, provide guidance and mentorship throughout feature development, and help avoid any wasted or duplicate effort.
|
||||
|
||||
@@ -99,7 +99,7 @@ In this release, we focused on new features, stability, and automation.
|
||||
|
||||
**✨Highlights**
|
||||
|
||||
- We focused on greatly improving Command Palette's performance and fixing a large amount of bugs. Some new features we've added are:
|
||||
- We focused on greatly improving the Command Palette's performance and fixing a large number of bugs. Some new features we've added are:
|
||||
- Added the ability for Command Palette to search any file using a fallback command.
|
||||
- Added the ability to make the Command Palette global hotkey a low-level keyboard hook.
|
||||
- Added open URL fallback command for the WebSearch extension, enabling users to directly open URLs in the browser from Command Palette.
|
||||
@@ -117,17 +117,17 @@ In this release, we focused on new features, stability, and automation.
|
||||
|
||||
### Command Not Found
|
||||
|
||||
- Updated the WinGet Command Not Found script to only enable the experimental features if they actually exist.
|
||||
- Updated the WinGet Command Not Found script to only enable the experimental features if they exist.
|
||||
|
||||
### Command Palette
|
||||
|
||||
- Updated bug template to include Command Palette module.
|
||||
- Fixed an issue where the toast window was not scaled for DPI, causing layout issues under display scaling.
|
||||
- Fixed an issue where Up/Down keyboard navigation didn't move selection when caret was at position 0, and add continuous navigation like PT Run v1. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Fixed an issue where Up/Down keyboard navigation didn't move selection when the caret was at position 0, and added continuous navigation like PT Run v1. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Updated the Time and Date extension code to simplify it and improve clarity.
|
||||
- Fixed an issue where capitalization in the command causes failure when trying to go to the mouse pointer, resolved by adjusting the command to lowercase.
|
||||
- Added open URL fallback command for the WebSearch extension, enabling users to directly open URLs in the browser from Command Palette. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Added setting to enable/disable system tray icon in CmdPal and align terminology with Windows 11. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Added open URL fallback command for the WebSearch extension, enabling users to directly open URLs in the browser from the Command Palette. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Added setting to enable/disable system tray icon in CmdPal and aligned terminology with Windows 11. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Fixed an alias update issue by removing the old alias when a new one is set.
|
||||
- Resolved GitHub casing conflict by migrating Exts and exts into a new ext directory, ensuring consistent structure across platforms and preventing path fragmentation.
|
||||
- Fix an issue where the 'Create New Extension' command generated empty file names.
|
||||
@@ -155,9 +155,9 @@ In this release, we focused on new features, stability, and automation.
|
||||
- Refactored CmdPal classes to improve JSON serialization and introduced new serialization contexts for better performance and maintainability.
|
||||
- Added support for ahead-of-time (AoT) compilation.
|
||||
- Added retry mechanism for CmdPal launch.
|
||||
- Removed some unused files from CmdPal.Common to simplify codebase and facilitate marking it as AoT-compatible.
|
||||
- Removed some unused files from CmdPal.Common to simplify the codebase and facilitate marking it as AoT-compatible.
|
||||
- Fixed a bug where a race condition in the update of SearchText caused the cursor in the input box to automatically jump to the end of the line, ensuring SearchText is only updated after it has actually been changed.
|
||||
- Added support for searching any file in fallback command.
|
||||
- Added support for searching any file in the fallback command.
|
||||
- Cleaned up AoT-related code to prevent duplicate operations during testing.
|
||||
- Reduced CmdPal load time by parallelizing extension startup and adding timeouts to prevent misbehaving extensions from blocking others.
|
||||
- Enhanced UI behavior by dismissing the details pane when the list gets emptied, avoiding inconsistent visual states.
|
||||
@@ -179,7 +179,7 @@ In this release, we focused on new features, stability, and automation.
|
||||
|
||||
### Keyboard Manager
|
||||
|
||||
- Fixed an issue where a modifier key, when set without specifying left or right, would get stuck due to incorrect key handling, by tracking the pressed keys and sending the correct key accordingly. Thanks [@mantaionut](https://github.com/mantaionut)!
|
||||
- Fixed an issue where a modifier key, when set without specifying left or right, would get stuck due to incorrect key handling by tracking the pressed keys and sending the correct key accordingly. Thanks [@mantaionut](https://github.com/mantaionut)!
|
||||
|
||||
### PowerRename
|
||||
|
||||
@@ -187,7 +187,7 @@ In this release, we focused on new features, stability, and automation.
|
||||
|
||||
### PowerToys Run
|
||||
|
||||
- Added support for custom formats in the "Time and Date" plugin and improves error messages for invalid input formats. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Added support for custom formats in the "Time and Date" plugin and improved error messages for invalid input formats. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Fix two crashes: one for WFT on very early dates and another for calculating the week of the month on very late dates (e.g., 31.12.9999), and reorder UI settings. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Fix an issue where capitalization in the command causes failure when trying to go to the mouse pointer, resolved by adjusting the command to lowercase.
|
||||
- Added version details to plugin error messages for 'Loading error' and 'Init error'. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
@@ -254,7 +254,7 @@ For [v0.92][github-next-release-work], we'll work on the items below:
|
||||
- New UI Automation tests
|
||||
- Working on installer upgrades
|
||||
- Upgrading Keyboard Manager's editor UI
|
||||
- Stability / bug fixes
|
||||
- Stability, bug fixes
|
||||
|
||||
## PowerToys Community
|
||||
|
||||
@@ -266,7 +266,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][oss-conduct
|
||||
|
||||
## Privacy Statement
|
||||
|
||||
The application logs basic diagnostic data (telemetry). For more information on privacy and what we collect, see our [PowerToys Data and Privacy documentation](https://aka.ms/powertoys-data-and-privacy-documentation).
|
||||
The application logs basic diagnostic data (telemetry). For more privacy information and what we collect, see our [PowerToys Data and Privacy documentation](https://aka.ms/powertoys-data-and-privacy-documentation).
|
||||
|
||||
[oss-CLA]: https://cla.opensource.microsoft.com
|
||||
[oss-conduct-code]: CODE_OF_CONDUCT.md
|
||||
|
||||
2
deps/cziplib
vendored
2
deps/cziplib
vendored
Submodule deps/cziplib updated: 7a57414261...81314fff0a
@@ -46,6 +46,7 @@ Contact the developers of a plugin directly for assistance with a specific plugi
|
||||
| [QuickNotes](https://github.com/ruslanlap/CommunityPowerToysRunPlugin-QuickNotes) | [ruslanlap](https://github.com/ruslanlap) | Create, manage, and search notes directly from PowerToys Run. |
|
||||
| [Weather](https://github.com/ruslanlap/PowerToysRun-Weather) | [ruslanlap](https://github.com/ruslanlap) | Get real-time weather information directly from PowerToys Run. |
|
||||
| [Pomodoro](https://github.com/ruslanlap/PowerToysRun-Pomodoro) | [ruslanlap](https://github.com/ruslanlap) | Manage Pomodoro productivity sessions directly from PowerToys Run. |
|
||||
| [Definition](https://github.com/ruslanlap/PowerToysRun-Definition) | [ruslanlap](https://github.com/ruslanlap) | Lookup word definitions, phonetics, and synonyms directly in PowerToys Run. |
|
||||
|
||||
## Extending software plugins
|
||||
|
||||
@@ -68,4 +69,5 @@ Below are community created plugins that target a website or software. They are
|
||||
| [Bilibili](https://github.com/Whuihuan/PowerToysRun-Bilibili) | [Whuihuan](https://github.com/Whuihuan) | Use AVID or BVID to parse and jump to Bilibili |
|
||||
| [YubicoOauthOTP](https://github.com/dlnilsson/Community.PowerToys.Run.Plugin.YubicoOauthOTP) | [dlnilsson](https://github.com/dlnilsson) | Display generated codes from OATH accounts stored on the YubiKey in powerToys Run |
|
||||
| [Firefox Bookmark](https://github.com/8LWXpg/PowerToysRun-FirefoxBookmark) | [8LWXpg](https://github.com/8LWXpg) | Open bookmarks in Firefox based browser |
|
||||
[Linear](https://github.com/vednig/powertoys-linear) | [vednig](https://github.com/vednig) | Create Linear Issues directly from Powertoys Run |
|
||||
| [Linear](https://github.com/vednig/powertoys-linear) | [vednig](https://github.com/vednig) | Create Linear Issues directly from Powertoys Run |
|
||||
| [SpeedTest](https://github.com/ruslanlap/PowerToysRun-SpeedTest) | [ruslanlap](https://github.com/ruslanlap) | One-command internet speed tests with real-time results, modern UI, and shareable links. |
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -43,4 +43,4 @@
|
||||
<Analyzer Remove="@(Analyzer)" Condition="%(Analyzer.NuGetPackageId) == 'Microsoft.Windows.CsWinRT'" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -76,3 +76,47 @@ using System.Diagnostics.CodeAnalysis;
|
||||
[assembly: SuppressMessage("CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator", "MVVMTK0049:Using [INotifyPropertyChanged] is not AOT compatible for WinRT", Justification = "Updated MVVM toolkit package introduced this.", Scope = "namespaceanddescendants", Target = "Peek.FilePreviewer")]
|
||||
[assembly: SuppressMessage("CommunityToolkit.Mvvm.SourceGenerators.INotifyPropertyChangedGenerator", "MVVMTK0049:Using [INotifyPropertyChanged] is not AOT compatible for WinRT", Justification = "Updated MVVM toolkit package introduced this.", Scope = "type", Target = "~T:Peek.UI.Views.TitleBar")]
|
||||
[assembly: SuppressMessage("CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator", "MVVMTK0049:Using [INotifyPropertyChanged] is not AOT compatible for WinRT", Justification = "Updated MVVM toolkit package introduced this.", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib")]
|
||||
|
||||
// HexBox control in RegistryPreviewUILib (We decided to copy the original code and not fix all theses problems for easier updating.)
|
||||
[assembly: SuppressMessage("Design", "CA1001:Types that own disposable fields should be disposable", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("Design", "CA1051:Do not declare visible instance fields", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("Globalization", "CA1305:Specify IFormatProvider", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("Naming", "CA1720:Identifiers should not contain type names", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("Performance", "CA1805:Do not initialize unnecessarily", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1623:Property summary documentation should match accessors", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1642:Constructor summary documentation should begin with standard text", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1648:<inheritdoc> has been used on an element that doesn't inherit from a base class or implement an interface.", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1500:Braces for multi-line statements should not share line", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1502:Element should not be on a single line", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1505:Opening braces should not be followed by blank line", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1507:Code should not contain multiple blank lines in a row", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1508:Closing braces should not be preceded by blank line", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1509:Opening braces should not be preceded by blank line", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1512:Single-line comments should not be followed by blank line", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1514:Element documentation header should be preceded by blank line", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1515:Single-line comment should be preceded by blank line", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1516:Elements should be separated by blank line", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1119:Statement should not use unnecessary parenthesis", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:Fields should be private", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1407:Arithmetic expressions should declare precedence", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1413:Use trailing comma in multi-line initializers", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1306:Field names should begin with lower-case letter", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1312:Variable names should begin with lower-case letter", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1313:Parameter names should begin with lower-case letter", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1200:Using directives should be placed correctly", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1108:Block statements should not contain embedded comments", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1117:Parameters should be on same line or separate lines", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1129:Do not use default value type constructor", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1000:Keywords should be spaced correctly", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1003:Symbols should be spaced correctly", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1005:Single line comments should begin with single space", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1024:Colons Should Be Spaced Correctly", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1025:Code should not contain multiple whitespace in a row", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1028:Code should not contain trailing whitespace", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
[assembly: SuppressMessage("Usage", "CsWinRT1028:Class is not marked partial", Justification = "<Code port with style preservation>", Scope = "namespaceanddescendants", Target = "RegistryPreviewUILib.HexBox")]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "Calculator.g.cpp"
|
||||
#include "ExprtkEvaluator.h"
|
||||
|
||||
namespace winrt::CmdPalCalculator::implementation
|
||||
namespace winrt::CalculatorEngineCommon::implementation
|
||||
{
|
||||
Calculator::Calculator(winrt::Windows::Foundation::Collections::IPropertySet const& constants)
|
||||
{
|
||||
@@ -11,13 +11,13 @@ namespace winrt::CmdPalCalculator::implementation
|
||||
{
|
||||
auto key = pair.Key();
|
||||
auto value = winrt::unbox_value<double>(pair.Value());
|
||||
m_constants.emplace(key.c_str(), value);
|
||||
m_constants.emplace(winrt::to_string(key), value);
|
||||
}
|
||||
}
|
||||
|
||||
hstring Calculator::EvaluateExpression(hstring const& expression)
|
||||
{
|
||||
auto result = ExprtkCalculator::internal::EvaluateExpression(expression.c_str(), m_constants);
|
||||
auto result = ExprtkCalculator::internal::EvaluateExpression(winrt::to_string(expression), m_constants);
|
||||
|
||||
return hstring(result);
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "Calculator.g.h"
|
||||
|
||||
namespace winrt::CmdPalCalculator::implementation
|
||||
namespace winrt::CalculatorEngineCommon::implementation
|
||||
{
|
||||
struct Calculator : CalculatorT<Calculator>
|
||||
{
|
||||
@@ -13,11 +13,11 @@ namespace winrt::CmdPalCalculator::implementation
|
||||
winrt::hstring EvaluateExpression(winrt::hstring const& expression);
|
||||
|
||||
private:
|
||||
std::unordered_map<std::wstring, double> m_constants;
|
||||
std::unordered_map<std::string, double> m_constants;
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::CmdPalCalculator::factory_implementation
|
||||
namespace winrt::CalculatorEngineCommon::factory_implementation
|
||||
{
|
||||
struct Calculator : CalculatorT<Calculator, implementation::Calculator>
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace CmdPalCalculator
|
||||
namespace CalculatorEngineCommon
|
||||
{
|
||||
[default_interface]
|
||||
runtimeclass Calculator
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
|
||||
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
|
||||
<ProjectGuid>{2cf78cf7-8feb-4be1-9591-55fa25b48fc6}</ProjectGuid>
|
||||
<ProjectName>CmdPalCalculator</ProjectName>
|
||||
<RootNamespace>CmdPalCalculator</RootNamespace>
|
||||
<ProjectName>CalculatorEngineCommon</ProjectName>
|
||||
<RootNamespace>CalculatorEngineCommon</RootNamespace>
|
||||
<AppxPackage>false</AppxPackage>
|
||||
</PropertyGroup>
|
||||
<!-- BEGIN common.build.pre.props -->
|
||||
@@ -65,8 +65,8 @@
|
||||
<Import Project="PropertySheet.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup>
|
||||
<TargetName>CmdPalCalculator</TargetName>
|
||||
<OutDir>..\..\..\..\$(Platform)\$(Configuration)\</OutDir>
|
||||
<TargetName>CalculatorEngineCommon</TargetName>
|
||||
<OutDir>..\..\..\$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
@@ -80,7 +80,7 @@
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
||||
<ModuleDefinitionFile>CmdPalCalculator.def</ModuleDefinitionFile>
|
||||
<ModuleDefinitionFile>CalculatorEngineCommon.def</ModuleDefinitionFile>
|
||||
<AdditionalDependencies>Shell32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
@@ -123,22 +123,27 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="CmdPalCalculator.def" />
|
||||
<None Include="CalculatorEngineCommon.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="PropertySheet.props" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<Import Project="..\..\..\..\deps\spdlog.props" />
|
||||
<Import Project="..\..\..\deps\spdlog.props" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\version\version.vcxproj">
|
||||
<Project>{cc6e41ac-8174-4e8a-8d22-85dd7f4851df}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
||||
</Target>
|
||||
<!-- BEGIN common.build.post.props -->
|
||||
<!--
|
||||
@@ -20,7 +20,7 @@
|
||||
<Midl Include="Calculator.idl" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="CmdPalCalculator.def" />
|
||||
<None Include="CalculatorEngineCommon.def" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
50
src/common/CalculatorEngineCommon/ExprtkEvaluator.cpp
Normal file
50
src/common/CalculatorEngineCommon/ExprtkEvaluator.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
#include "ExprtkEvaluator.h"
|
||||
#include "exprtk.hpp"
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
namespace ExprtkCalculator::internal
|
||||
{
|
||||
|
||||
std::wstring ToWStringFullPrecision(double value)
|
||||
{
|
||||
std::wostringstream oss;
|
||||
oss << std::fixed << std::setprecision(15) << value;
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
std::wstring EvaluateExpression(
|
||||
const std::string& expressionText,
|
||||
const std::unordered_map<std::string, double>& constants)
|
||||
{
|
||||
exprtk::symbol_table<double> symbol_table;
|
||||
|
||||
for (auto const& [name, value] : constants)
|
||||
{
|
||||
symbol_table.add_constant(name, value);
|
||||
}
|
||||
|
||||
exprtk::expression<double> expression;
|
||||
expression.register_symbol_table(symbol_table);
|
||||
|
||||
exprtk::parser<double> parser;
|
||||
|
||||
// Enable all base functions and arithmetic operators
|
||||
parser.settings().enable_all_base_functions(); // Enable all base functions like sin, cos, log, etc.
|
||||
parser.settings().enable_all_arithmetic_ops(); // Enable all arithmetic operators like +, -, *, /, etc.
|
||||
|
||||
// Disable all control structures and assignment operators to ensure only expressions are evaluated
|
||||
parser.settings().disable_all_control_structures(); // Disable control structures like if, for, while, etc.
|
||||
parser.settings().disable_all_assignment_ops(); // Disable assignment operators like =, +=, -=, etc.
|
||||
|
||||
// Disabled for now, but can be enabled later for enhanced functionality
|
||||
parser.settings().disable_all_logic_ops(); // Disable logical operators like &&, ||, !, etc.
|
||||
parser.settings().disable_all_inequality_ops(); // Disable inequality operators like <, >, <=, >=, !=, etc.
|
||||
|
||||
if (!parser.compile(expressionText, expression))
|
||||
return L"NaN";
|
||||
|
||||
return ToWStringFullPrecision(expression.value());
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
namespace ExprtkCalculator::internal
|
||||
{
|
||||
std::wstring EvaluateExpression(
|
||||
const std::wstring& expression,
|
||||
const std::unordered_map<std::wstring, double>& constants = {});
|
||||
const std::string& expression,
|
||||
const std::unordered_map<std::string, double>& constants);
|
||||
}
|
||||
4
src/common/CalculatorEngineCommon/packages.config
Normal file
4
src/common/CalculatorEngineCommon/packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.240111.5" targetFramework="native" />
|
||||
</packages>
|
||||
29
src/common/CalculatorEngineCommon/readme.md
Normal file
29
src/common/CalculatorEngineCommon/readme.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# C++/WinRT CalculatorEngine Project Overview
|
||||
|
||||
This project wraps the exprtk expression parsing library with a C++/WinRT component,
|
||||
making advanced mathematical evaluation capabilities available to Windows applications.
|
||||
It is designed specifically to provide calculation support for the CmdPal calculator extension.
|
||||
|
||||
## Using exprtk
|
||||
|
||||
This project uses [exprtk](https://github.com/ArashPartow/exprtk) as the
|
||||
expression parsing and evaluation engine.
|
||||
|
||||
How to use exprtk in this project:
|
||||
- The exprtk header file (`exprtk.hpp`) is included in the project source.
|
||||
- You can use exprtk to parse and evaluate mathematical expressions in your
|
||||
C++ code. For example:
|
||||
|
||||
```cpp
|
||||
#include "exprtk.hpp"
|
||||
exprtk::expression<double> expression;
|
||||
exprtk::parser<double> parser;
|
||||
std::string formula = "3 + 4 * 2";
|
||||
parser.compile(formula, expression);
|
||||
double result = expression.value();
|
||||
```
|
||||
|
||||
How to update exprtk:
|
||||
1. Download the latest `exprtk.hpp` from the [official repository](https://github.com/ArashPartow/exprtk).
|
||||
2. Replace the existing `exprtk.hpp` file in the project with the new version.
|
||||
3. Rebuild the project to ensure compatibility and take advantage of any updates.
|
||||
@@ -29,7 +29,9 @@ namespace ManagedCommon
|
||||
* If you want to publish it with Native AOT enabled (or publish as a single file).
|
||||
* You need to find another way to remove Assembly.Location usage.
|
||||
*/
|
||||
private static readonly string Version = "2.0.0";
|
||||
#pragma warning disable IL3000 // Avoid accessing Assembly file path when publishing as a single file
|
||||
private static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location).ProductVersion;
|
||||
#pragma warning restore IL3000 // Avoid accessing Assembly file path when publishing as a single file
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the logger and sets the path for logging.
|
||||
|
||||
@@ -37,6 +37,17 @@ namespace Microsoft.PowerToys.Telemetry
|
||||
public void WriteEvent<T>(T telemetryEvent)
|
||||
where T : EventBase, IEvent
|
||||
{
|
||||
if (DataDiagnosticsSettings.GetEnabledValue())
|
||||
{
|
||||
this.Write<T>(
|
||||
telemetryEvent.EventName,
|
||||
new EventSourceOptions()
|
||||
{
|
||||
Keywords = ProjectKeywordMeasure,
|
||||
Tags = ProjectTelemetryTagProductAndServicePerformance,
|
||||
},
|
||||
telemetryEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"AreaPath": "OS\\Windows Client and Services\\WinPD\\DFX-Developer Fundamentals and Experiences\\DEFT\\SALT",
|
||||
"IterationPath": "OS\\Future"
|
||||
},
|
||||
"jobNotificationEmail": "leilzh@microsoft.com",
|
||||
"jobNotificationEmail": "PowerToys@microsoft.com",
|
||||
"skip": false,
|
||||
"rebootAfterSetup": false,
|
||||
"oneFuzzJobs": [
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
"AreaPath": "OS\\Windows Client and Services\\WinPD\\DFX-Developer Fundamentals and Experiences\\DEFT\\SALT",
|
||||
"IterationPath": "OS\\Future"
|
||||
},
|
||||
"jobNotificationEmail": "mengyuanchen@microsoft.com",
|
||||
"jobNotificationEmail": "PowerToys@microsoft.com",
|
||||
"skip": false,
|
||||
"rebootAfterSetup": false,
|
||||
"oneFuzzJobs": [
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">System</dpiAwareness>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
|
||||
|
||||
239
src/modules/Workspaces/WorkspacesLib.UnitTests/AppUtilsTests.cpp
Normal file
239
src/modules/Workspaces/WorkspacesLib.UnitTests/AppUtilsTests.cpp
Normal file
@@ -0,0 +1,239 @@
|
||||
#include "pch.h"
|
||||
#include <filesystem> // Add this line
|
||||
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
|
||||
namespace WorkspacesLibUnitTests
|
||||
{
|
||||
TEST_CLASS(AppUtilsTests)
|
||||
{
|
||||
public:
|
||||
TEST_METHOD(GetCurrentFolder_ReturnsNonEmptyPath)
|
||||
{
|
||||
// Act
|
||||
const std::wstring& result = Utils::Apps::GetCurrentFolder();
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result.empty());
|
||||
Assert::IsTrue(std::filesystem::exists(result));
|
||||
}
|
||||
|
||||
TEST_METHOD(GetCurrentFolderUpper_ReturnsUppercasePath)
|
||||
{
|
||||
// Act
|
||||
const std::wstring& currentFolder = Utils::Apps::GetCurrentFolder();
|
||||
const std::wstring& currentFolderUpper = Utils::Apps::GetCurrentFolderUpper();
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(currentFolderUpper.empty());
|
||||
Assert::AreEqual(currentFolder.length(), currentFolderUpper.length());
|
||||
|
||||
// Verify it's actually uppercase
|
||||
std::wstring expectedUpper = currentFolder;
|
||||
std::transform(expectedUpper.begin(), expectedUpper.end(), expectedUpper.begin(), towupper);
|
||||
Assert::AreEqual(expectedUpper, currentFolderUpper);
|
||||
}
|
||||
|
||||
TEST_METHOD(GetCurrentFolder_ConsistentResults)
|
||||
{
|
||||
// Act
|
||||
const std::wstring& result1 = Utils::Apps::GetCurrentFolder();
|
||||
const std::wstring& result2 = Utils::Apps::GetCurrentFolder();
|
||||
|
||||
// Assert
|
||||
Assert::AreEqual(result1, result2);
|
||||
}
|
||||
|
||||
TEST_METHOD(GetCurrentFolderUpper_ConsistentResults)
|
||||
{
|
||||
// Act
|
||||
const std::wstring& result1 = Utils::Apps::GetCurrentFolderUpper();
|
||||
const std::wstring& result2 = Utils::Apps::GetCurrentFolderUpper();
|
||||
|
||||
// Assert
|
||||
Assert::AreEqual(result1, result2);
|
||||
}
|
||||
|
||||
TEST_METHOD(AppData_IsEdge_EdgePath_ReturnsTrue)
|
||||
{
|
||||
// Arrange
|
||||
Utils::Apps::AppData appData;
|
||||
appData.installPath = L"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe";
|
||||
|
||||
// Act
|
||||
bool result = appData.IsEdge();
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(AppData_IsEdge_NonEdgePath_ReturnsFalse)
|
||||
{
|
||||
// Arrange
|
||||
Utils::Apps::AppData appData;
|
||||
appData.installPath = L"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe";
|
||||
|
||||
// Act
|
||||
bool result = appData.IsEdge();
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(AppData_IsEdge_EmptyPath_ReturnsFalse)
|
||||
{
|
||||
// Arrange
|
||||
Utils::Apps::AppData appData;
|
||||
appData.installPath = L"";
|
||||
|
||||
// Act
|
||||
bool result = appData.IsEdge();
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(AppData_IsChrome_ChromePath_ReturnsTrue)
|
||||
{
|
||||
// Arrange
|
||||
Utils::Apps::AppData appData;
|
||||
appData.installPath = L"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe";
|
||||
|
||||
// Act
|
||||
bool result = appData.IsChrome();
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(AppData_IsChrome_NonChromePath_ReturnsFalse)
|
||||
{
|
||||
// Arrange
|
||||
Utils::Apps::AppData appData;
|
||||
appData.installPath = L"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe";
|
||||
|
||||
// Act
|
||||
bool result = appData.IsChrome();
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(AppData_IsChrome_EmptyPath_ReturnsFalse)
|
||||
{
|
||||
// Arrange
|
||||
Utils::Apps::AppData appData;
|
||||
appData.installPath = L"";
|
||||
|
||||
// Act
|
||||
bool result = appData.IsChrome();
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(AppData_IsSteamGame_SteamProtocol_ReturnsTrue)
|
||||
{
|
||||
// Arrange
|
||||
Utils::Apps::AppData appData;
|
||||
appData.protocolPath = L"steam://run/123456";
|
||||
|
||||
// Act
|
||||
bool result = appData.IsSteamGame();
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(AppData_IsSteamGame_NonSteamProtocol_ReturnsFalse)
|
||||
{
|
||||
// Arrange
|
||||
Utils::Apps::AppData appData;
|
||||
appData.protocolPath = L"https://example.com";
|
||||
|
||||
// Act
|
||||
bool result = appData.IsSteamGame();
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(AppData_IsSteamGame_EmptyProtocol_ReturnsFalse)
|
||||
{
|
||||
// Arrange
|
||||
Utils::Apps::AppData appData;
|
||||
appData.protocolPath = L"";
|
||||
|
||||
// Act
|
||||
bool result = appData.IsSteamGame();
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(AppData_IsSteamGame_PartialSteamString_ReturnsFalse)
|
||||
{
|
||||
// Arrange
|
||||
Utils::Apps::AppData appData;
|
||||
appData.protocolPath = L"http://run/123456";
|
||||
|
||||
// Act
|
||||
bool result = appData.IsSteamGame();
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(AppData_DefaultValues)
|
||||
{
|
||||
// Arrange & Act
|
||||
Utils::Apps::AppData appData;
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(appData.name.empty());
|
||||
Assert::IsTrue(appData.installPath.empty());
|
||||
Assert::IsTrue(appData.packageFullName.empty());
|
||||
Assert::IsTrue(appData.appUserModelId.empty());
|
||||
Assert::IsTrue(appData.pwaAppId.empty());
|
||||
Assert::IsTrue(appData.protocolPath.empty());
|
||||
Assert::IsFalse(appData.canLaunchElevated);
|
||||
}
|
||||
|
||||
TEST_METHOD(AppData_MultipleBrowserDetection)
|
||||
{
|
||||
// Arrange
|
||||
Utils::Apps::AppData edgeApp;
|
||||
edgeApp.installPath = L"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe";
|
||||
|
||||
Utils::Apps::AppData chromeApp;
|
||||
chromeApp.installPath = L"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe";
|
||||
|
||||
Utils::Apps::AppData otherApp;
|
||||
otherApp.installPath = L"C:\\Program Files\\Firefox\\firefox.exe";
|
||||
|
||||
// Act & Assert
|
||||
Assert::IsTrue(edgeApp.IsEdge());
|
||||
Assert::IsFalse(edgeApp.IsChrome());
|
||||
Assert::IsFalse(edgeApp.IsSteamGame());
|
||||
|
||||
Assert::IsFalse(chromeApp.IsEdge());
|
||||
Assert::IsTrue(chromeApp.IsChrome());
|
||||
Assert::IsFalse(chromeApp.IsSteamGame());
|
||||
|
||||
Assert::IsFalse(otherApp.IsEdge());
|
||||
Assert::IsFalse(otherApp.IsChrome());
|
||||
Assert::IsFalse(otherApp.IsSteamGame());
|
||||
}
|
||||
|
||||
TEST_METHOD(GetAppsList_ReturnsAppList)
|
||||
{
|
||||
// Act
|
||||
Utils::Apps::AppList apps = Utils::Apps::GetAppsList();
|
||||
|
||||
// Assert
|
||||
// The list can be empty or non-empty depending on the system
|
||||
// But it should not crash and should return a valid list
|
||||
Assert::IsTrue(apps.size() >= 0);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
#include "pch.h"
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
|
||||
namespace WorkspacesLibUnitTests
|
||||
{
|
||||
TEST_CLASS (JsonUtilsTests)
|
||||
{
|
||||
private:
|
||||
std::wstring CreateTempJsonFile(const std::wstring& content)
|
||||
{
|
||||
std::wstring tempPath = std::filesystem::temp_directory_path();
|
||||
tempPath += L"\\test_workspace_" + std::to_wstring(GetTickCount64()) + L".json";
|
||||
|
||||
std::wofstream file(tempPath);
|
||||
file << content;
|
||||
file.close();
|
||||
|
||||
return tempPath;
|
||||
}
|
||||
|
||||
void DeleteTempFile(const std::wstring& filePath)
|
||||
{
|
||||
if (std::filesystem::exists(filePath))
|
||||
{
|
||||
std::filesystem::remove(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
TEST_METHOD (ReadSingleWorkspace_NonExistentFile_ReturnsEmptyWorkspace)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring nonExistentFile = L"C:\\NonExistent\\File.json";
|
||||
|
||||
// Act
|
||||
auto result = JsonUtils::ReadSingleWorkspace(nonExistentFile);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result.isOk());
|
||||
auto workspace = result.value();
|
||||
Assert::IsTrue(workspace.name.empty());
|
||||
}
|
||||
|
||||
TEST_METHOD (ReadSingleWorkspace_InvalidJsonFile_ReturnsError)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring tempFile = CreateTempJsonFile(L"invalid json content {");
|
||||
|
||||
// Act
|
||||
auto result = JsonUtils::ReadSingleWorkspace(tempFile);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result.isError());
|
||||
Assert::AreEqual(static_cast<int>(JsonUtils::WorkspacesFileError::IncorrectFileError),
|
||||
static_cast<int>(result.error()));
|
||||
|
||||
// Cleanup
|
||||
DeleteTempFile(tempFile);
|
||||
}
|
||||
|
||||
TEST_METHOD (ReadWorkspaces_NonExistentFile_ReturnsEmptyVector)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring nonExistentFile = L"C:\\NonExistent\\File.json";
|
||||
|
||||
// Act
|
||||
auto result = JsonUtils::ReadWorkspaces(nonExistentFile);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result.isError());
|
||||
Assert::AreEqual(static_cast<int>(JsonUtils::WorkspacesFileError::IncorrectFileError),
|
||||
static_cast<int>(result.error()));
|
||||
}
|
||||
|
||||
TEST_METHOD (ReadWorkspaces_InvalidJsonFile_ReturnsError)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring tempFile = CreateTempJsonFile(L"invalid json content {");
|
||||
|
||||
// Act
|
||||
auto result = JsonUtils::ReadWorkspaces(tempFile);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result.isError());
|
||||
Assert::AreEqual(static_cast<int>(JsonUtils::WorkspacesFileError::IncorrectFileError),
|
||||
static_cast<int>(result.error()));
|
||||
|
||||
// Cleanup
|
||||
DeleteTempFile(tempFile);
|
||||
}
|
||||
|
||||
TEST_METHOD (Write_ValidWorkspace_ReturnsTrue)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring tempPath = std::filesystem::temp_directory_path();
|
||||
tempPath += L"\\test_write_workspace_" + std::to_wstring(GetTickCount64()) + L".json";
|
||||
|
||||
WorkspacesData::WorkspacesProject workspace;
|
||||
workspace.name = L"Test Workspace";
|
||||
|
||||
// Convert string to time_t
|
||||
std::tm tm = {};
|
||||
workspace.creationTime = std::mktime(&tm);
|
||||
|
||||
// Act
|
||||
bool result = JsonUtils::Write(tempPath, workspace);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result);
|
||||
Assert::IsTrue(std::filesystem::exists(tempPath));
|
||||
|
||||
// Cleanup
|
||||
DeleteTempFile(tempPath);
|
||||
}
|
||||
|
||||
TEST_METHOD (Write_ValidWorkspacesList_ReturnsTrue)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring tempPath = std::filesystem::temp_directory_path();
|
||||
tempPath += L"\\test_write_workspaces_" + std::to_wstring(GetTickCount64()) + L".json";
|
||||
|
||||
std::vector<WorkspacesData::WorkspacesProject> workspaces;
|
||||
|
||||
WorkspacesData::WorkspacesProject workspace1;
|
||||
workspace1.name = L"Test Workspace 1";
|
||||
workspace1.creationTime = std::time(nullptr);
|
||||
|
||||
WorkspacesData::WorkspacesProject workspace2;
|
||||
workspace2.name = L"Test Workspace 2";
|
||||
workspace2.creationTime = std::time(nullptr);
|
||||
|
||||
workspaces.push_back(workspace1);
|
||||
workspaces.push_back(workspace2);
|
||||
|
||||
// Act
|
||||
bool result = JsonUtils::Write(tempPath, workspaces);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result);
|
||||
Assert::IsTrue(std::filesystem::exists(tempPath));
|
||||
|
||||
// Cleanup
|
||||
DeleteTempFile(tempPath);
|
||||
}
|
||||
|
||||
TEST_METHOD (Write_EmptyWorkspacesList_ReturnsTrue)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring tempPath = std::filesystem::temp_directory_path();
|
||||
tempPath += L"\\test_write_empty_" + std::to_wstring(GetTickCount64()) + L".json";
|
||||
|
||||
std::vector<WorkspacesData::WorkspacesProject> emptyWorkspaces;
|
||||
|
||||
// Act
|
||||
bool result = JsonUtils::Write(tempPath, emptyWorkspaces);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result);
|
||||
Assert::IsTrue(std::filesystem::exists(tempPath));
|
||||
|
||||
// Cleanup
|
||||
DeleteTempFile(tempPath);
|
||||
}
|
||||
|
||||
/*
|
||||
TEST_METHOD(Write_InvalidPath_ReturnsFalse)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring invalidPath = L"C:\\NonExistent\\Path\\workspace.json";
|
||||
|
||||
WorkspacesData::WorkspacesProject workspace;
|
||||
workspace.name = L"Test Workspace";
|
||||
workspace.creationTime = std::time(nullptr);
|
||||
|
||||
// Act
|
||||
bool result = JsonUtils::Write(invalidPath, workspace);
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result);
|
||||
}
|
||||
*/
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
#include "pch.h"
|
||||
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
|
||||
namespace WorkspacesLibUnitTests
|
||||
{
|
||||
TEST_CLASS (PwaHelperTests)
|
||||
{
|
||||
public:
|
||||
TEST_METHOD (PwaHelper_Constructor_DoesNotThrow)
|
||||
{
|
||||
// Act & Assert - Constructor should not crash when called
|
||||
try
|
||||
{
|
||||
Utils::PwaHelper helper;
|
||||
// If we get here, the constructor didn't throw
|
||||
Assert::IsTrue(true);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
Assert::Fail(L"PwaHelper constructor should not throw exceptions");
|
||||
}
|
||||
}
|
||||
|
||||
TEST_METHOD (PwaHelper_GetEdgeAppId_EmptyAumid_ReturnsEmpty)
|
||||
{
|
||||
// Arrange
|
||||
Utils::PwaHelper helper;
|
||||
std::wstring emptyAumid = L"";
|
||||
|
||||
// Act
|
||||
auto result = helper.GetEdgeAppId(emptyAumid);
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result.has_value());
|
||||
}
|
||||
|
||||
TEST_METHOD (PwaHelper_GetChromeAppId_EmptyAumid_ReturnsEmpty)
|
||||
{
|
||||
// Arrange
|
||||
Utils::PwaHelper helper;
|
||||
std::wstring emptyAumid = L"";
|
||||
|
||||
// Act
|
||||
auto result = helper.GetChromeAppId(emptyAumid);
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result.has_value());
|
||||
}
|
||||
|
||||
TEST_METHOD (PwaHelper_SearchPwaName_EmptyParameters_ReturnsEmpty)
|
||||
{
|
||||
// Arrange
|
||||
Utils::PwaHelper helper;
|
||||
std::wstring emptyPwaAppId = L"";
|
||||
std::wstring emptyWindowAumid = L"";
|
||||
|
||||
// Act
|
||||
std::wstring result = helper.SearchPwaName(emptyPwaAppId, emptyWindowAumid);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result.empty());
|
||||
}
|
||||
|
||||
TEST_METHOD (PwaHelper_SearchPwaName_NonExistentIds_ReturnsEmpty)
|
||||
{
|
||||
// Arrange
|
||||
Utils::PwaHelper helper;
|
||||
std::wstring nonExistentPwaAppId = L"nonexistent_app_id";
|
||||
std::wstring nonExistentWindowAumid = L"nonexistent_aumid";
|
||||
|
||||
// Act
|
||||
std::wstring result = helper.SearchPwaName(nonExistentPwaAppId, nonExistentWindowAumid);
|
||||
|
||||
// TODO: is it really expected?
|
||||
Assert::IsTrue(result == nonExistentWindowAumid);
|
||||
}
|
||||
|
||||
TEST_METHOD (PwaHelper_GetAUMIDFromWindow_InvalidWindow_ReturnsEmpty)
|
||||
{
|
||||
// Arrange
|
||||
Utils::PwaHelper helper;
|
||||
HWND invalidWindow = nullptr;
|
||||
|
||||
// Act
|
||||
std::wstring result = helper.GetAUMIDFromWindow(invalidWindow);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result.empty());
|
||||
}
|
||||
|
||||
TEST_METHOD (PwaHelper_GetEdgeAppId_ValidConstruction_DoesNotCrash)
|
||||
{
|
||||
// Arrange
|
||||
Utils::PwaHelper helper;
|
||||
std::wstring testAumid = L"Microsoft.MicrosoftEdge_8wekyb3d8bbwe!App";
|
||||
|
||||
// Act & Assert - Should not crash
|
||||
auto result = helper.GetEdgeAppId(testAumid);
|
||||
// Result can be empty or have value, but should not crash
|
||||
}
|
||||
|
||||
TEST_METHOD (PwaHelper_GetChromeAppId_ValidConstruction_DoesNotCrash)
|
||||
{
|
||||
// Arrange
|
||||
Utils::PwaHelper helper;
|
||||
std::wstring testAumid = L"Chrome.App.TestId";
|
||||
|
||||
// Act & Assert - Should not crash
|
||||
auto result = helper.GetChromeAppId(testAumid);
|
||||
// Result can be empty or have value, but should not crash
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
#include "pch.h"
|
||||
#include <StringUtils.h>
|
||||
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
|
||||
namespace WorkspacesLibUnitTests
|
||||
{
|
||||
TEST_CLASS(StringUtilsTests)
|
||||
{
|
||||
public:
|
||||
TEST_METHOD(CaseInsensitiveEquals_SameStrings_ReturnsTrue)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring str1 = L"test";
|
||||
std::wstring str2 = L"test";
|
||||
|
||||
// Act
|
||||
bool result = StringUtils::CaseInsensitiveEquals(str1, str2);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(CaseInsensitiveEquals_DifferentCase_ReturnsTrue)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring str1 = L"Test";
|
||||
std::wstring str2 = L"TEST";
|
||||
|
||||
// Act
|
||||
bool result = StringUtils::CaseInsensitiveEquals(str1, str2);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(CaseInsensitiveEquals_MixedCase_ReturnsTrue)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring str1 = L"TeSt StRiNg";
|
||||
std::wstring str2 = L"test STRING";
|
||||
|
||||
// Act
|
||||
bool result = StringUtils::CaseInsensitiveEquals(str1, str2);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(CaseInsensitiveEquals_DifferentStrings_ReturnsFalse)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring str1 = L"test";
|
||||
std::wstring str2 = L"different";
|
||||
|
||||
// Act
|
||||
bool result = StringUtils::CaseInsensitiveEquals(str1, str2);
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(CaseInsensitiveEquals_DifferentLengths_ReturnsFalse)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring str1 = L"test";
|
||||
std::wstring str2 = L"testing";
|
||||
|
||||
// Act
|
||||
bool result = StringUtils::CaseInsensitiveEquals(str1, str2);
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(CaseInsensitiveEquals_EmptyStrings_ReturnsTrue)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring str1 = L"";
|
||||
std::wstring str2 = L"";
|
||||
|
||||
// Act
|
||||
bool result = StringUtils::CaseInsensitiveEquals(str1, str2);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(CaseInsensitiveEquals_OneEmpty_ReturnsFalse)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring str1 = L"test";
|
||||
std::wstring str2 = L"";
|
||||
|
||||
// Act
|
||||
bool result = StringUtils::CaseInsensitiveEquals(str1, str2);
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result);
|
||||
}
|
||||
|
||||
TEST_METHOD(CaseInsensitiveEquals_SpecialCharacters_ReturnsTrue)
|
||||
{
|
||||
// Arrange
|
||||
std::wstring str1 = L"Test-123_Special!";
|
||||
std::wstring str2 = L"test-123_special!";
|
||||
|
||||
// Act
|
||||
bool result = StringUtils::CaseInsensitiveEquals(str1, str2);
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(result);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
#include "pch.h"
|
||||
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
|
||||
namespace WorkspacesLibUnitTests
|
||||
{
|
||||
TEST_CLASS(WorkspacesDataTests)
|
||||
{
|
||||
public:
|
||||
TEST_METHOD(WorkspacesFile_ReturnsValidPath)
|
||||
{
|
||||
// Act
|
||||
std::wstring result = WorkspacesData::WorkspacesFile();
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result.empty());
|
||||
Assert::IsTrue(result.find(L"workspaces.json") != std::wstring::npos);
|
||||
}
|
||||
|
||||
TEST_METHOD(TempWorkspacesFile_ReturnsValidPath)
|
||||
{
|
||||
// Act
|
||||
std::wstring result = WorkspacesData::TempWorkspacesFile();
|
||||
|
||||
// Assert
|
||||
Assert::IsFalse(result.empty());
|
||||
Assert::IsTrue(result.find(L"temp-workspaces.json") != std::wstring::npos);
|
||||
}
|
||||
|
||||
TEST_METHOD(WorkspacesFile_TempWorkspacesFile_DifferentPaths)
|
||||
{
|
||||
// Act
|
||||
std::wstring workspacesFile = WorkspacesData::WorkspacesFile();
|
||||
std::wstring tempWorkspacesFile = WorkspacesData::TempWorkspacesFile();
|
||||
|
||||
// Assert
|
||||
Assert::AreNotEqual(workspacesFile, tempWorkspacesFile);
|
||||
}
|
||||
|
||||
TEST_METHOD(Position_ToRect_ConvertsCorrectly)
|
||||
{
|
||||
// Arrange
|
||||
WorkspacesData::WorkspacesProject::Application::Position position;
|
||||
position.x = 100;
|
||||
position.y = 200;
|
||||
position.width = 800;
|
||||
position.height = 600;
|
||||
|
||||
// Act
|
||||
RECT rect = position.toRect();
|
||||
|
||||
// Assert
|
||||
Assert::AreEqual(100, static_cast<int>(rect.left));
|
||||
Assert::AreEqual(200, static_cast<int>(rect.top));
|
||||
Assert::AreEqual(900, static_cast<int>(rect.right)); // x + width
|
||||
Assert::AreEqual(800, static_cast<int>(rect.bottom)); // y + height
|
||||
}
|
||||
|
||||
TEST_METHOD(Position_ToRect_ZeroPosition)
|
||||
{
|
||||
// Arrange
|
||||
WorkspacesData::WorkspacesProject::Application::Position position;
|
||||
position.x = 0;
|
||||
position.y = 0;
|
||||
position.width = 0;
|
||||
position.height = 0;
|
||||
|
||||
// Act
|
||||
RECT rect = position.toRect();
|
||||
|
||||
// Assert
|
||||
Assert::AreEqual(0, static_cast<int>(rect.left));
|
||||
Assert::AreEqual(0, static_cast<int>(rect.top));
|
||||
Assert::AreEqual(0, static_cast<int>(rect.right));
|
||||
Assert::AreEqual(0, static_cast<int>(rect.bottom));
|
||||
}
|
||||
|
||||
TEST_METHOD(Position_ToRect_NegativeCoordinates)
|
||||
{
|
||||
// Arrange
|
||||
WorkspacesData::WorkspacesProject::Application::Position position;
|
||||
position.x = -100;
|
||||
position.y = -50;
|
||||
position.width = 200;
|
||||
position.height = 150;
|
||||
|
||||
// Act
|
||||
RECT rect = position.toRect();
|
||||
|
||||
// Assert
|
||||
Assert::AreEqual(-100, static_cast<int>(rect.left));
|
||||
Assert::AreEqual(-50, static_cast<int>(rect.top));
|
||||
Assert::AreEqual(100, static_cast<int>(rect.right)); // -100 + 200
|
||||
Assert::AreEqual(100, static_cast<int>(rect.bottom)); // -50 + 150
|
||||
}
|
||||
|
||||
TEST_METHOD(Application_DefaultValues)
|
||||
{
|
||||
// Arrange & Act
|
||||
WorkspacesData::WorkspacesProject::Application app;
|
||||
|
||||
// Assert
|
||||
Assert::IsTrue(app.id.empty());
|
||||
Assert::IsTrue(app.name.empty());
|
||||
Assert::IsTrue(app.title.empty());
|
||||
Assert::IsTrue(app.path.empty());
|
||||
Assert::IsTrue(app.packageFullName.empty());
|
||||
Assert::IsTrue(app.appUserModelId.empty());
|
||||
Assert::IsTrue(app.pwaAppId.empty());
|
||||
Assert::IsTrue(app.commandLineArgs.empty());
|
||||
Assert::IsFalse(app.isElevated);
|
||||
Assert::IsFalse(app.canLaunchElevated);
|
||||
Assert::IsFalse(app.isMinimized);
|
||||
Assert::IsFalse(app.isMaximized);
|
||||
Assert::AreEqual(0, static_cast<int>(app.position.x));
|
||||
Assert::AreEqual(0, static_cast<int>(app.position.y));
|
||||
Assert::AreEqual(0, static_cast<int>(app.position.width));
|
||||
Assert::AreEqual(0, static_cast<int>(app.position.height));
|
||||
Assert::AreEqual(0u, static_cast<unsigned int>(app.monitor));
|
||||
}
|
||||
|
||||
TEST_METHOD(Application_Comparison_EqualObjects)
|
||||
{
|
||||
// Arrange
|
||||
WorkspacesData::WorkspacesProject::Application app1;
|
||||
app1.id = L"test-id";
|
||||
app1.name = L"Test App";
|
||||
app1.position.x = 100;
|
||||
app1.position.y = 200;
|
||||
|
||||
WorkspacesData::WorkspacesProject::Application app2;
|
||||
app2.id = L"test-id";
|
||||
app2.name = L"Test App";
|
||||
app2.position.x = 100;
|
||||
app2.position.y = 200;
|
||||
|
||||
// Act & Assert
|
||||
Assert::IsTrue(app1 == app2);
|
||||
}
|
||||
|
||||
TEST_METHOD(Application_Comparison_DifferentObjects)
|
||||
{
|
||||
// Arrange
|
||||
WorkspacesData::WorkspacesProject::Application app1;
|
||||
app1.id = L"test-id-1";
|
||||
app1.name = L"Test App 1";
|
||||
|
||||
WorkspacesData::WorkspacesProject::Application app2;
|
||||
app2.id = L"test-id-2";
|
||||
app2.name = L"Test App 2";
|
||||
|
||||
// Act & Assert
|
||||
Assert::IsTrue(app1 != app2);
|
||||
}
|
||||
|
||||
TEST_METHOD(Position_Comparison_EqualPositions)
|
||||
{
|
||||
// Arrange
|
||||
WorkspacesData::WorkspacesProject::Application::Position pos1;
|
||||
pos1.x = 100;
|
||||
pos1.y = 200;
|
||||
pos1.width = 800;
|
||||
pos1.height = 600;
|
||||
|
||||
WorkspacesData::WorkspacesProject::Application::Position pos2;
|
||||
pos2.x = 100;
|
||||
pos2.y = 200;
|
||||
pos2.width = 800;
|
||||
pos2.height = 600;
|
||||
|
||||
// Act & Assert
|
||||
Assert::IsTrue(pos1 == pos2);
|
||||
}
|
||||
|
||||
TEST_METHOD(Position_Comparison_DifferentPositions)
|
||||
{
|
||||
// Arrange
|
||||
WorkspacesData::WorkspacesProject::Application::Position pos1;
|
||||
pos1.x = 100;
|
||||
pos1.y = 200;
|
||||
pos1.width = 800;
|
||||
pos1.height = 600;
|
||||
|
||||
WorkspacesData::WorkspacesProject::Application::Position pos2;
|
||||
pos2.x = 150;
|
||||
pos2.y = 200;
|
||||
pos2.width = 800;
|
||||
pos2.height = 600;
|
||||
|
||||
// Act & Assert
|
||||
Assert::IsTrue(pos1 != pos2);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{A85D4D9F-9A39-4B5D-8B5A-9F2D5C9A8B4C}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>WorkspacesLibUnitTests</RootNamespace>
|
||||
<ProjectName>WorkspacesLibUnitTests</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Label="Configuration">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<OutDir>..\..\..\..\$(Platform)\$(Configuration)\tests\Workspaces\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\;..\WorkspacesLib\;$(SolutionDir)src\;$(SolutionDir)src\common;$(SolutionDir)src\common\Telemetry;..\..\;..\..\..\;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<UseFullPaths>true</UseFullPaths>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\\lib;$(SolutionDir)$(Platform)\\$(Configuration)\\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>propsys.lib;comctl32.lib;pathcch.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Pathcch.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WorkspacesDataTests.cpp" />
|
||||
<ClCompile Include="StringUtilsTests.cpp" />
|
||||
<ClCompile Include="JsonUtilsTests.cpp" />
|
||||
<ClCompile Include="AppUtilsTests.cpp" />
|
||||
<ClCompile Include="PwaHelperTests.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\common\SettingsAPI\SettingsAPI.vcxproj">
|
||||
<Project>{6955446d-23f7-4023-9bb3-8657f904af99}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WorkspacesLib\WorkspacesLib.vcxproj">
|
||||
<Project>{b31fcc55-b5a4-4ea7-b414-2dceae6af332}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
</ImportGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WorkspacesDataTests.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StringUtilsTests.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="JsonUtilsTests.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AppUtilsTests.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PwaHelperTests.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.240111.5" targetFramework="native" />
|
||||
</packages>
|
||||
1
src/modules/Workspaces/WorkspacesLib.UnitTests/pch.cpp
Normal file
1
src/modules/Workspaces/WorkspacesLib.UnitTests/pch.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include "pch.h"
|
||||
21
src/modules/Workspaces/WorkspacesLib.UnitTests/pch.h
Normal file
21
src/modules/Workspaces/WorkspacesLib.UnitTests/pch.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
|
||||
// Headers for CppUnitTest
|
||||
#pragma warning(disable : 26466)
|
||||
#include "CppUnitTest.h"
|
||||
|
||||
// Windows headers
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <optional>
|
||||
|
||||
// Workspaces headers
|
||||
#include <WorkspacesLib/WorkspacesData.h>
|
||||
#include <WorkspacesLib/JsonUtils.h>
|
||||
#include <WorkspacesLib/Result.h>
|
||||
#include <WorkspacesLib/AppUtils.h>
|
||||
#include <WorkspacesLib/PwaHelper.h>
|
||||
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
// Including SDKDDKVer.h defines the highest available Windows platform.
|
||||
|
||||
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
|
||||
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
|
||||
|
||||
#include <SDKDDKVer.h>
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace StringUtils
|
||||
{
|
||||
bool CaseInsensitiveEquals(const std::wstring& str1, const std::wstring& str2)
|
||||
inline bool CaseInsensitiveEquals(const std::wstring& str1, const std::wstring& str2)
|
||||
{
|
||||
if (str1.size() != str2.size())
|
||||
{
|
||||
|
||||
@@ -69,10 +69,10 @@ namespace WorkspacesData
|
||||
|
||||
std::wstring id;
|
||||
std::wstring name;
|
||||
time_t creationTime;
|
||||
time_t creationTime{};
|
||||
std::optional<time_t> lastLaunchedTime;
|
||||
bool isShortcutNeeded;
|
||||
bool moveExistingWindows;
|
||||
bool isShortcutNeeded{};
|
||||
bool moveExistingWindows{};
|
||||
std::vector<Monitor> monitors;
|
||||
std::vector<Application> apps;
|
||||
};
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
#include "ExprtkEvaluator.h"
|
||||
#include "exprtk.hpp"
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
namespace ExprtkCalculator::internal
|
||||
{
|
||||
|
||||
std::wstring ToWStringFullPrecision(double value)
|
||||
{
|
||||
std::wostringstream oss;
|
||||
oss << std::fixed << std::setprecision(15) << value;
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
std::string WStringToAscii(const std::wstring& wstr)
|
||||
{
|
||||
std::string result;
|
||||
result.reserve(wstr.size());
|
||||
for (wchar_t wc : wstr)
|
||||
result.push_back(static_cast<char>(wc));
|
||||
return result;
|
||||
}
|
||||
|
||||
std::wstring EvaluateExpression(
|
||||
const std::wstring& wexpr,
|
||||
const std::unordered_map<std::wstring, double>& constants)
|
||||
{
|
||||
exprtk::symbol_table<double> symbol_table;
|
||||
|
||||
for (auto const& [name, value] : constants)
|
||||
{
|
||||
symbol_table.add_constant(WStringToAscii(name.c_str()), value);
|
||||
}
|
||||
|
||||
exprtk::expression<double> expression;
|
||||
expression.register_symbol_table(symbol_table);
|
||||
|
||||
exprtk::parser<double> parser;
|
||||
if (!parser.compile(WStringToAscii(wexpr), expression))
|
||||
return L"NaN";
|
||||
|
||||
return ToWStringFullPrecision(expression.value());
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.220531.1" targetFramework="native" />
|
||||
</packages>
|
||||
@@ -1,23 +0,0 @@
|
||||
========================================================================
|
||||
C++/WinRT CmdPalCalculator Project Overview
|
||||
========================================================================
|
||||
|
||||
This project demonstrates how to get started authoring Windows Runtime
|
||||
classes directly with standard C++, using the C++/WinRT SDK component
|
||||
to generate implementation headers from interface (IDL) files. The
|
||||
generated Windows Runtime component binary and WinMD files should then
|
||||
be bundled with the Universal Windows Platform (UWP) app consuming them.
|
||||
|
||||
Steps:
|
||||
1. Create an interface (IDL) file to define your Windows Runtime class,
|
||||
its default interface, and any other interfaces it implements.
|
||||
2. Build the project once to generate module.g.cpp, module.h.cpp, and
|
||||
implementation templates under the "Generated Files" folder, as
|
||||
well as skeleton class definitions under "Generated Files\sources".
|
||||
3. Use the skeleton class definitions for reference to implement your
|
||||
Windows Runtime classes.
|
||||
|
||||
========================================================================
|
||||
Learn more about C++/WinRT here:
|
||||
http://aka.ms/cppwinrt/
|
||||
========================================================================
|
||||
@@ -12,6 +12,6 @@
|
||||
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.7.250513003" />
|
||||
<PackageVersion Include="Shmuelie.WinRTServer" Version="2.1.1" />
|
||||
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
|
||||
<PackageVersion Include="System.Text.Json" Version="9.0.5" />
|
||||
<PackageVersion Include="System.Text.Json" Version="9.0.6" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Text.Json;
|
||||
using AdaptiveCards.ObjectModel.WinUI3;
|
||||
using AdaptiveCards.Templating;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.UI.ViewModels.Messages;
|
||||
using Microsoft.CmdPal.UI.ViewModels.Models;
|
||||
using Microsoft.CommandPalette.Extensions;
|
||||
using Windows.Data.Json;
|
||||
@@ -22,14 +27,145 @@ public partial class ContentFormViewModel(IFormContent _form, WeakReference<IPag
|
||||
|
||||
public string DataJson { get; protected set; } = "{}";
|
||||
|
||||
public AdaptiveCardParseResult? Card { get; private set; }
|
||||
|
||||
private static string Serialize(string? s) =>
|
||||
JsonSerializer.Serialize(s, JsonSerializationContext.Default.String);
|
||||
|
||||
public override void InitializeProperties()
|
||||
private static bool TryBuildCard(
|
||||
string templateJson,
|
||||
string dataJson,
|
||||
out AdaptiveCardParseResult? card,
|
||||
out Exception? error)
|
||||
{
|
||||
card = null;
|
||||
error = null;
|
||||
|
||||
try
|
||||
{
|
||||
var template = new AdaptiveCardTemplate(templateJson);
|
||||
var cardJson = template.Expand(dataJson);
|
||||
card = AdaptiveCard.FromJsonString(cardJson);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError("Error building card from template: {Message}", ex.Message);
|
||||
error = ex;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleSubmit()
|
||||
public override void InitializeProperties()
|
||||
{
|
||||
var model = _formModel.Unsafe;
|
||||
if (model is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TemplateJson = model.TemplateJson;
|
||||
StateJson = model.StateJson;
|
||||
DataJson = model.DataJson;
|
||||
|
||||
if (TryBuildCard(TemplateJson, DataJson, out var builtCard, out var renderingError))
|
||||
{
|
||||
Card = builtCard;
|
||||
UpdateProperty(nameof(Card));
|
||||
return;
|
||||
}
|
||||
|
||||
var errorPayload = $$"""
|
||||
{
|
||||
"error_message": {{Serialize(renderingError!.Message)}},
|
||||
"error_stack": {{Serialize(renderingError.StackTrace)}},
|
||||
"inner_exception": {{Serialize(renderingError.InnerException?.Message)}},
|
||||
"template_json": {{Serialize(TemplateJson)}},
|
||||
"data_json": {{Serialize(DataJson)}}
|
||||
}
|
||||
""";
|
||||
|
||||
if (TryBuildCard(ErrorCardJson, errorPayload, out var errorCard, out var _))
|
||||
{
|
||||
Card = errorCard;
|
||||
UpdateProperty(nameof(Card));
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateProperty(nameof(Card));
|
||||
}
|
||||
|
||||
public void HandleSubmit(IAdaptiveActionElement action, JsonObject inputs)
|
||||
{
|
||||
if (action is AdaptiveOpenUrlAction openUrlAction)
|
||||
{
|
||||
WeakReferenceMessenger.Default.Send<LaunchUriMessage>(new(openUrlAction.Url));
|
||||
return;
|
||||
}
|
||||
|
||||
if (action is AdaptiveSubmitAction or AdaptiveExecuteAction)
|
||||
{
|
||||
// Get the data and inputs
|
||||
var dataString = (action as AdaptiveSubmitAction)?.DataJson.Stringify() ?? string.Empty;
|
||||
var inputString = inputs.Stringify();
|
||||
|
||||
_ = Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var model = _formModel.Unsafe!;
|
||||
if (model != null)
|
||||
{
|
||||
var result = model.SubmitForm(inputString, dataString);
|
||||
WeakReferenceMessenger.Default.Send<HandleCommandResultMessage>(new(new(result)));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowException(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly string ErrorCardJson = """
|
||||
{
|
||||
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
|
||||
"type": "AdaptiveCard",
|
||||
"version": "1.5",
|
||||
"body": [
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"text": "Error parsing form from extension",
|
||||
"wrap": true,
|
||||
"style": "heading",
|
||||
"size": "ExtraLarge",
|
||||
"weight": "Bolder",
|
||||
"color": "Attention"
|
||||
},
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"wrap": true,
|
||||
"text": "${error_message}",
|
||||
"color": "Attention"
|
||||
},
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"text": "${error_stack}",
|
||||
"fontType": "Monospace"
|
||||
},
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"wrap": true,
|
||||
"text": "Inner exception:"
|
||||
},
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"wrap": true,
|
||||
"text": "${inner_exception}",
|
||||
"color": "Attention"
|
||||
}
|
||||
]
|
||||
}
|
||||
""";
|
||||
}
|
||||
|
||||
@@ -79,6 +79,9 @@ public partial class ContentPageViewModel : PageViewModel, ICommandBarContext
|
||||
throw;
|
||||
}
|
||||
|
||||
var oneContent = newContent.Count == 1;
|
||||
newContent.ForEach(c => c.OnlyControlOnPage = oneContent);
|
||||
|
||||
// Now, back to a UI thread to update the observable collection
|
||||
DoOnUiThread(
|
||||
() =>
|
||||
|
||||
@@ -7,4 +7,5 @@ namespace Microsoft.CmdPal.UI.ViewModels;
|
||||
public abstract partial class ContentViewModel(WeakReference<IPageContext> context) :
|
||||
ExtensionObjectViewModel(context)
|
||||
{
|
||||
public bool OnlyControlOnPage { get; internal set; }
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommunityToolkit.Common" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" />
|
||||
<PackageReference Include="AdaptiveCards.Templating" />
|
||||
<PackageReference Include="AdaptiveCards.ObjectModel.WinUI3" GeneratePathProperty="true" />
|
||||
|
||||
<PackageReference Include="Microsoft.Windows.CsWin32">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
|
||||
@@ -98,13 +98,13 @@ public partial class App : Application
|
||||
var allApps = new AllAppsCommandProvider();
|
||||
services.AddSingleton<ICommandProvider>(allApps);
|
||||
services.AddSingleton<ICommandProvider, ShellCommandsProvider>();
|
||||
services.AddSingleton<ICommandProvider, CalculatorCommandProvider>();
|
||||
services.AddSingleton<ICommandProvider, IndexerCommandsProvider>();
|
||||
services.AddSingleton<ICommandProvider, BookmarksCommandProvider>();
|
||||
|
||||
services.AddSingleton<ICommandProvider, ClipboardHistoryCommandsProvider>();
|
||||
services.AddSingleton<ICommandProvider, WindowWalkerCommandsProvider>();
|
||||
services.AddSingleton<ICommandProvider, WebSearchCommandsProvider>();
|
||||
services.AddSingleton<ICommandProvider, CalculatorCommandProvider>();
|
||||
|
||||
// GH #38440: Users might not have WinGet installed! Or they might have
|
||||
// a ridiculously old version. Or might be running as admin.
|
||||
|
||||
@@ -0,0 +1,342 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using AdaptiveCards.Rendering.WinUI3;
|
||||
|
||||
namespace Microsoft.CmdPal.UI.Controls;
|
||||
|
||||
public sealed class AdaptiveCardsConfig
|
||||
{
|
||||
public static AdaptiveHostConfig Light { get; }
|
||||
|
||||
public static AdaptiveHostConfig Dark { get; }
|
||||
|
||||
static AdaptiveCardsConfig()
|
||||
{
|
||||
Light = AdaptiveHostConfig.FromJsonString(LightHostConfigString).HostConfig;
|
||||
Dark = AdaptiveHostConfig.FromJsonString(DarkHostConfigString).HostConfig;
|
||||
}
|
||||
|
||||
public static readonly string DarkHostConfigString = """
|
||||
{
|
||||
"spacing": {
|
||||
"small": 4,
|
||||
"default": 8,
|
||||
"medium": 20,
|
||||
"large": 30,
|
||||
"extraLarge": 40,
|
||||
"padding": 8
|
||||
},
|
||||
"separator": {
|
||||
"lineThickness": 0,
|
||||
"lineColor": "#C8FFFFFF"
|
||||
},
|
||||
"supportsInteractivity": true,
|
||||
"fontTypes": {
|
||||
"default": {
|
||||
"fontFamily": "'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
|
||||
"fontSizes": {
|
||||
"small": 12,
|
||||
"default": 12,
|
||||
"medium": 14,
|
||||
"large": 20,
|
||||
"extraLarge": 26
|
||||
},
|
||||
"fontWeights": {
|
||||
"lighter": 200,
|
||||
"default": 400,
|
||||
"bolder": 600
|
||||
}
|
||||
},
|
||||
"monospace": {
|
||||
"fontFamily": "'Courier New', Courier, monospace",
|
||||
"fontSizes": {
|
||||
"small": 12,
|
||||
"default": 12,
|
||||
"medium": 14,
|
||||
"large": 18,
|
||||
"extraLarge": 26
|
||||
},
|
||||
"fontWeights": {
|
||||
"lighter": 200,
|
||||
"default": 400,
|
||||
"bolder": 600
|
||||
}
|
||||
}
|
||||
},
|
||||
"containerStyles": {
|
||||
"default": {
|
||||
"backgroundColor": "#00000000",
|
||||
"borderColor": "#00000000",
|
||||
"foregroundColors": {
|
||||
"default": {
|
||||
"default": "#FFFFFF",
|
||||
"subtle": "#C8FFFFFF"
|
||||
},
|
||||
"accent": {
|
||||
"default": "#0063B1",
|
||||
"subtle": "#880063B1"
|
||||
},
|
||||
"attention": {
|
||||
"default": "#FF5555",
|
||||
"subtle": "#DDFF5555"
|
||||
},
|
||||
"good": {
|
||||
"default": "#54a254",
|
||||
"subtle": "#DD54a254"
|
||||
},
|
||||
"warning": {
|
||||
"default": "#c3ab23",
|
||||
"subtle": "#DDc3ab23"
|
||||
}
|
||||
}
|
||||
},
|
||||
"emphasis": {
|
||||
"backgroundColor": "#09FFFFFF",
|
||||
"borderColor": "#09FFFFFF",
|
||||
"foregroundColors": {
|
||||
"default": {
|
||||
"default": "#FFFFFF",
|
||||
"subtle": "#C8FFFFFF"
|
||||
},
|
||||
"accent": {
|
||||
"default": "#2E89FC",
|
||||
"subtle": "#882E89FC"
|
||||
},
|
||||
"attention": {
|
||||
"default": "#FF5555",
|
||||
"subtle": "#DDFF5555"
|
||||
},
|
||||
"good": {
|
||||
"default": "#54a254",
|
||||
"subtle": "#DD54a254"
|
||||
},
|
||||
"warning": {
|
||||
"default": "#c3ab23",
|
||||
"subtle": "#DDc3ab23"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"imageSizes": {
|
||||
"small": 16,
|
||||
"medium": 24,
|
||||
"large": 32
|
||||
},
|
||||
"actions": {
|
||||
"maxActions": 5,
|
||||
"spacing": "default",
|
||||
"buttonSpacing": 8,
|
||||
"showCard": {
|
||||
"actionMode": "inline",
|
||||
"inlineTopMargin": 8
|
||||
},
|
||||
"actionsOrientation": "horizontal",
|
||||
"actionAlignment": "stretch"
|
||||
},
|
||||
"adaptiveCard": {
|
||||
"allowCustomStyle": false
|
||||
},
|
||||
"imageSet": {
|
||||
"imageSize": "medium",
|
||||
"maxImageHeight": 100
|
||||
},
|
||||
"factSet": {
|
||||
"title": {
|
||||
"color": "default",
|
||||
"size": "default",
|
||||
"isSubtle": false,
|
||||
"weight": "bolder",
|
||||
"wrap": true,
|
||||
"maxWidth": 150
|
||||
},
|
||||
"value": {
|
||||
"color": "default",
|
||||
"size": "default",
|
||||
"isSubtle": false,
|
||||
"weight": "default",
|
||||
"wrap": true
|
||||
},
|
||||
"spacing": 8
|
||||
},
|
||||
"textStyles": {
|
||||
"heading": {
|
||||
"size": "large",
|
||||
"weight": "bolder",
|
||||
"color": "default",
|
||||
"isSubtle": false,
|
||||
"fontType": "default"
|
||||
},
|
||||
"columnHeader": {
|
||||
"size": "medium",
|
||||
"weight": "bolder",
|
||||
"color": "default",
|
||||
"isSubtle": false,
|
||||
"fontType": "default"
|
||||
}
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
public static readonly string LightHostConfigString = """
|
||||
{
|
||||
"spacing": {
|
||||
"small": 4,
|
||||
"default": 8,
|
||||
"medium": 20,
|
||||
"large": 30,
|
||||
"extraLarge": 40,
|
||||
"padding": 8
|
||||
},
|
||||
"separator": {
|
||||
"lineThickness": 0,
|
||||
"lineColor": "#606060"
|
||||
},
|
||||
"supportsInteractivity": true,
|
||||
"fontTypes": {
|
||||
"default": {
|
||||
"fontFamily": "'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
|
||||
"fontSizes": {
|
||||
"small": 12,
|
||||
"default": 12,
|
||||
"medium": 14,
|
||||
"large": 20,
|
||||
"extraLarge": 26
|
||||
},
|
||||
"fontWeights": {
|
||||
"lighter": 200,
|
||||
"default": 400,
|
||||
"bolder": 600
|
||||
}
|
||||
},
|
||||
"monospace": {
|
||||
"fontFamily": "'Courier New', Courier, monospace",
|
||||
"fontSizes": {
|
||||
"small": 12,
|
||||
"default": 12,
|
||||
"medium": 14,
|
||||
"large": 18,
|
||||
"extraLarge": 26
|
||||
},
|
||||
"fontWeights": {
|
||||
"lighter": 200,
|
||||
"default": 400,
|
||||
"bolder": 600
|
||||
}
|
||||
}
|
||||
},
|
||||
"containerStyles": {
|
||||
"default": {
|
||||
"backgroundColor": "#00000000",
|
||||
"borderColor": "#00000000",
|
||||
"foregroundColors": {
|
||||
"default": {
|
||||
"default": "#E6000000",
|
||||
"subtle": "#99000000"
|
||||
},
|
||||
"accent": {
|
||||
"default": "#0063B1",
|
||||
"subtle": "#880063B1"
|
||||
},
|
||||
"attention": {
|
||||
"default": "#C00000",
|
||||
"subtle": "#DDC00000"
|
||||
},
|
||||
"good": {
|
||||
"default": "#54a254",
|
||||
"subtle": "#DD54a254"
|
||||
},
|
||||
"warning": {
|
||||
"default": "#c3ab23",
|
||||
"subtle": "#DDc3ab23"
|
||||
}
|
||||
}
|
||||
},
|
||||
"emphasis": {
|
||||
"backgroundColor": "#80F6F6F6",
|
||||
"borderColor": "#80F6F6F6",
|
||||
"foregroundColors": {
|
||||
"default": {
|
||||
"default": "#E6000000",
|
||||
"subtle": "#99000000"
|
||||
},
|
||||
"accent": {
|
||||
"default": "#2E89FC",
|
||||
"subtle": "#882E89FC"
|
||||
},
|
||||
"attention": {
|
||||
"default": "#C00000",
|
||||
"subtle": "#DDC00000"
|
||||
},
|
||||
"good": {
|
||||
"default": "#54a254",
|
||||
"subtle": "#DD54a254"
|
||||
},
|
||||
"warning": {
|
||||
"default": "#c3ab23",
|
||||
"subtle": "#DDc3ab23"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"imageSizes": {
|
||||
"small": 16,
|
||||
"medium": 24,
|
||||
"large": 32
|
||||
},
|
||||
"actions": {
|
||||
"maxActions": 5,
|
||||
"spacing": "default",
|
||||
"buttonSpacing": 8,
|
||||
"showCard": {
|
||||
"actionMode": "inline",
|
||||
"inlineTopMargin": 8
|
||||
},
|
||||
"actionsOrientation": "horizontal",
|
||||
"actionAlignment": "stretch"
|
||||
},
|
||||
"adaptiveCard": {
|
||||
"allowCustomStyle": false
|
||||
},
|
||||
"imageSet": {
|
||||
"imageSize": "medium",
|
||||
"maxImageHeight": 100
|
||||
},
|
||||
"factSet": {
|
||||
"title": {
|
||||
"color": "default",
|
||||
"size": "default",
|
||||
"isSubtle": false,
|
||||
"weight": "bolder",
|
||||
"wrap": true,
|
||||
"maxWidth": 150
|
||||
},
|
||||
"value": {
|
||||
"color": "default",
|
||||
"size": "default",
|
||||
"isSubtle": false,
|
||||
"weight": "default",
|
||||
"wrap": true
|
||||
},
|
||||
"spacing": 8
|
||||
},
|
||||
"textStyles": {
|
||||
"heading": {
|
||||
"size": "large",
|
||||
"weight": "bolder",
|
||||
"color": "default",
|
||||
"isSubtle": false,
|
||||
"fontType": "default"
|
||||
},
|
||||
"columnHeader": {
|
||||
"size": "medium",
|
||||
"weight": "bolder",
|
||||
"color": "default",
|
||||
"isSubtle": false,
|
||||
"fontType": "default"
|
||||
}
|
||||
}
|
||||
}
|
||||
""";
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<UserControl
|
||||
x:Class="Microsoft.CmdPal.UI.Controls.ContentFormControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:Microsoft.CmdPal.UI.Controls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||
xmlns:viewmodels="using:Microsoft.CmdPal.UI.ViewModels"
|
||||
Background="Transparent"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary x:Name="CardOverrideStyles">
|
||||
<Style x:Key="Adaptive.TextBlock" TargetType="TextBlock">
|
||||
<Setter Property="IsTextSelectionEnabled" Value="True" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid x:Name="ContentGrid" />
|
||||
</UserControl>
|
||||
@@ -0,0 +1,162 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using AdaptiveCards.ObjectModel.WinUI3;
|
||||
using AdaptiveCards.Rendering.WinUI3;
|
||||
using Microsoft.CmdPal.UI.ViewModels;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
|
||||
namespace Microsoft.CmdPal.UI.Controls;
|
||||
|
||||
public sealed partial class ContentFormControl : UserControl
|
||||
{
|
||||
private static readonly AdaptiveCardRenderer _renderer;
|
||||
private ContentFormViewModel? _viewModel;
|
||||
|
||||
// LOAD-BEARING: if you don't hang onto a reference to the RenderedAdaptiveCard
|
||||
// then the GC might clean it up sometime, even while the card is in the UI
|
||||
// tree. If this gets GC'ed, then it'll revoke our Action handler, and the
|
||||
// form will do seemingly nothing.
|
||||
private RenderedAdaptiveCard? _renderedCard;
|
||||
|
||||
public ContentFormViewModel? ViewModel { get => _viewModel; set => AttachViewModel(value); }
|
||||
|
||||
static ContentFormControl()
|
||||
{
|
||||
// We can't use `CardOverrideStyles` here yet, because we haven't called InitializeComponent once.
|
||||
// But also, the default value isn't `null` here. It's... some other default empty value.
|
||||
// So clear it out so that we know when the first time we get created is
|
||||
_renderer = new AdaptiveCardRenderer()
|
||||
{
|
||||
OverrideStyles = null,
|
||||
};
|
||||
}
|
||||
|
||||
public ContentFormControl()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
var lightTheme = ActualTheme == Microsoft.UI.Xaml.ElementTheme.Light;
|
||||
_renderer.HostConfig = lightTheme ? AdaptiveCardsConfig.Light : AdaptiveCardsConfig.Dark;
|
||||
|
||||
// 5% BODGY: if we set this multiple times over the lifetime of the app,
|
||||
// then the second call will explode, because "CardOverrideStyles is already the child of another element".
|
||||
// SO only set this once.
|
||||
if (_renderer.OverrideStyles == null)
|
||||
{
|
||||
_renderer.OverrideStyles = CardOverrideStyles;
|
||||
}
|
||||
|
||||
// TODO in the future, we should handle ActualThemeChanged and replace
|
||||
// our rendered card with one for that theme. But today is not that day
|
||||
}
|
||||
|
||||
private void AttachViewModel(ContentFormViewModel? vm)
|
||||
{
|
||||
if (_viewModel != null)
|
||||
{
|
||||
_viewModel.PropertyChanged -= ViewModel_PropertyChanged;
|
||||
}
|
||||
|
||||
_viewModel = vm;
|
||||
|
||||
if (_viewModel != null)
|
||||
{
|
||||
_viewModel.PropertyChanged += ViewModel_PropertyChanged;
|
||||
|
||||
var c = _viewModel.Card;
|
||||
if (c != null)
|
||||
{
|
||||
DisplayCard(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ViewModel_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (ViewModel == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.PropertyName == nameof(ViewModel.Card))
|
||||
{
|
||||
var c = ViewModel.Card;
|
||||
if (c != null)
|
||||
{
|
||||
DisplayCard(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DisplayCard(AdaptiveCardParseResult result)
|
||||
{
|
||||
_renderedCard = _renderer.RenderAdaptiveCard(result.AdaptiveCard);
|
||||
ContentGrid.Children.Clear();
|
||||
if (_renderedCard.FrameworkElement != null)
|
||||
{
|
||||
ContentGrid.Children.Add(_renderedCard.FrameworkElement);
|
||||
|
||||
// Use the Loaded event to ensure we focus after the card is in the visual tree
|
||||
_renderedCard.FrameworkElement.Loaded += OnFrameworkElementLoaded;
|
||||
}
|
||||
|
||||
_renderedCard.Action += Rendered_Action;
|
||||
}
|
||||
|
||||
private void OnFrameworkElementLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// Unhook the event handler to avoid multiple registrations
|
||||
if (sender is FrameworkElement element)
|
||||
{
|
||||
element.Loaded -= OnFrameworkElementLoaded;
|
||||
|
||||
if (!ViewModel?.OnlyControlOnPage ?? true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Focus on the first focusable element asynchronously to ensure the visual tree is fully built
|
||||
element.DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal, () =>
|
||||
{
|
||||
var focusableElement = FindFirstFocusableElement(element);
|
||||
focusableElement?.Focus(FocusState.Programmatic);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private Control? FindFirstFocusableElement(DependencyObject parent)
|
||||
{
|
||||
var childCount = VisualTreeHelper.GetChildrenCount(parent);
|
||||
|
||||
// Process children first (depth-first search)
|
||||
for (var i = 0; i < childCount; i++)
|
||||
{
|
||||
var child = VisualTreeHelper.GetChild(parent, i);
|
||||
|
||||
// If the child is a focusable control like TextBox, ComboBox, etc.
|
||||
if (child is Control control &&
|
||||
control.IsEnabled &&
|
||||
control.IsTabStop &&
|
||||
control.Visibility == Visibility.Visible &&
|
||||
control.AllowFocusOnInteraction)
|
||||
{
|
||||
return control;
|
||||
}
|
||||
|
||||
// Recursively check children
|
||||
var result = FindFirstFocusableElement(child);
|
||||
if (result != null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void Rendered_Action(RenderedAdaptiveCard sender, AdaptiveActionEventArgs args) =>
|
||||
ViewModel?.HandleSubmit(args.Action, args.Inputs.AsJson());
|
||||
}
|
||||
@@ -12,7 +12,7 @@ public delegate bool IsActive();
|
||||
|
||||
public delegate bool FilterAccessibleKeyboardEvents(int key, UIntPtr extraInfo);
|
||||
|
||||
public partial class HotkeySettingsControlHook : IDisposable
|
||||
public class HotkeySettingsControlHook : IDisposable
|
||||
{
|
||||
private const int WmKeyDown = 0x100;
|
||||
private const int WmKeyUp = 0x101;
|
||||
|
||||
@@ -5,81 +5,82 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
|
||||
internal static class NativeKeyboardHelper
|
||||
namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Matching Native Structure")]
|
||||
internal struct INPUT
|
||||
internal static class NativeKeyboardHelper
|
||||
{
|
||||
internal INPUTTYPE type;
|
||||
internal InputUnion data;
|
||||
|
||||
internal static int Size
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Matching Native Structure")]
|
||||
internal struct INPUT
|
||||
{
|
||||
get { return Marshal.SizeOf<INPUT>(); }
|
||||
internal INPUTTYPE type;
|
||||
internal InputUnion data;
|
||||
|
||||
internal static int Size
|
||||
{
|
||||
get { return Marshal.SizeOf(typeof(INPUT)); }
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Matching Native Structure")]
|
||||
internal struct InputUnion
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
internal MOUSEINPUT mi;
|
||||
[FieldOffset(0)]
|
||||
internal KEYBDINPUT ki;
|
||||
[FieldOffset(0)]
|
||||
internal HARDWAREINPUT hi;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Matching Native Structure")]
|
||||
internal struct MOUSEINPUT
|
||||
{
|
||||
internal int dx;
|
||||
internal int dy;
|
||||
internal int mouseData;
|
||||
internal uint dwFlags;
|
||||
internal uint time;
|
||||
internal UIntPtr dwExtraInfo;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Matching Native Structure")]
|
||||
internal struct KEYBDINPUT
|
||||
{
|
||||
internal short wVk;
|
||||
internal short wScan;
|
||||
internal uint dwFlags;
|
||||
internal int time;
|
||||
internal UIntPtr dwExtraInfo;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Matching Native Structure")]
|
||||
internal struct HARDWAREINPUT
|
||||
{
|
||||
internal int uMsg;
|
||||
internal short wParamL;
|
||||
internal short wParamH;
|
||||
}
|
||||
|
||||
internal enum INPUTTYPE : uint
|
||||
{
|
||||
INPUT_MOUSE = 0,
|
||||
INPUT_KEYBOARD = 1,
|
||||
INPUT_HARDWARE = 2,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
internal enum KeyEventF
|
||||
{
|
||||
KeyDown = 0x0000,
|
||||
ExtendedKey = 0x0001,
|
||||
KeyUp = 0x0002,
|
||||
Unicode = 0x0004,
|
||||
Scancode = 0x0008,
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Matching Native Structure")]
|
||||
internal struct InputUnion
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
internal MOUSEINPUT mi;
|
||||
[FieldOffset(0)]
|
||||
internal KEYBDINPUT ki;
|
||||
[FieldOffset(0)]
|
||||
internal HARDWAREINPUT hi;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Matching Native Structure")]
|
||||
internal struct MOUSEINPUT
|
||||
{
|
||||
internal int dx;
|
||||
internal int dy;
|
||||
internal int mouseData;
|
||||
internal uint dwFlags;
|
||||
internal uint time;
|
||||
internal UIntPtr dwExtraInfo;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Matching Native Structure")]
|
||||
internal struct KEYBDINPUT
|
||||
{
|
||||
internal short wVk;
|
||||
internal short wScan;
|
||||
internal uint dwFlags;
|
||||
internal int time;
|
||||
internal UIntPtr dwExtraInfo;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Matching Native Structure")]
|
||||
internal struct HARDWAREINPUT
|
||||
{
|
||||
internal int uMsg;
|
||||
internal short wParamL;
|
||||
internal short wParamH;
|
||||
}
|
||||
|
||||
internal enum INPUTTYPE : uint
|
||||
{
|
||||
INPUT_MOUSE = 0,
|
||||
INPUT_KEYBOARD = 1,
|
||||
INPUT_HARDWARE = 2,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
internal enum KeyEventF
|
||||
{
|
||||
KeyDown = 0x0000,
|
||||
ExtendedKey = 0x0001,
|
||||
KeyUp = 0x0002,
|
||||
Unicode = 0x0004,
|
||||
Scancode = 0x0008,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Text;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
|
||||
public static partial class NativeMethods
|
||||
public static class NativeMethods
|
||||
{
|
||||
private const int WS_POPUP = 1 << 31; // 0x80000000
|
||||
internal const int GWL_STYLE = -16;
|
||||
@@ -26,11 +26,11 @@ public static partial class NativeMethods
|
||||
[DllImport("user32.dll")]
|
||||
internal static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl);
|
||||
|
||||
[LibraryImport("user32.dll")]
|
||||
internal static partial uint SendInput(uint nInputs, NativeKeyboardHelper.INPUT[] pInputs, int cbSize);
|
||||
[DllImport("user32.dll")]
|
||||
internal static extern uint SendInput(uint nInputs, NativeKeyboardHelper.INPUT[] pInputs, int cbSize);
|
||||
|
||||
[LibraryImport("user32.dll")]
|
||||
internal static partial short GetAsyncKeyState(int vKey);
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
|
||||
internal static extern short GetAsyncKeyState(int vKey);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
internal static extern int GetWindowLong(IntPtr hWnd, int nIndex);
|
||||
|
||||
@@ -66,6 +66,11 @@
|
||||
IsTabStop="{Binding ElementName=ShortcutContentControl, Path=IsWarningAltGr, Mode=OneWay}"
|
||||
Severity="Warning" />
|
||||
</Grid>
|
||||
<tk7controls:MarkdownTextBlock
|
||||
x:Uid="InvalidShortcutWarningLabel"
|
||||
Background="Transparent"
|
||||
FontSize="12"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -36,5 +36,10 @@
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<tk7controls:MarkdownTextBlock
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
Text="{x:Bind Text}" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -37,21 +37,37 @@
|
||||
|
||||
<DataTemplate x:Key="FormContentTemplate" x:DataType="viewmodels:ContentFormViewModel">
|
||||
<Grid Margin="0,4,4,4" Padding="12,8,8,8">
|
||||
<cmdPalControls:ContentFormControl ViewModel="{x:Bind}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="MarkdownContentTemplate" x:DataType="viewmodels:ContentMarkdownViewModel">
|
||||
<Grid Margin="0,4,4,4" Padding="12,8,8,8">
|
||||
<toolkit:MarkdownTextBlock
|
||||
Background="Transparent"
|
||||
Header3FontSize="12"
|
||||
Header3FontWeight="Normal"
|
||||
Header3Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
IsTextSelectionEnabled="True"
|
||||
Text="{x:Bind Body, Mode=OneWay}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="NestedFormContentTemplate" x:DataType="viewmodels:ContentFormViewModel">
|
||||
<Grid>
|
||||
<cmdPalControls:ContentFormControl ViewModel="{x:Bind}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="NestedMarkdownContentTemplate" x:DataType="viewmodels:ContentMarkdownViewModel">
|
||||
<Grid>
|
||||
<toolkit:MarkdownTextBlock
|
||||
Background="Transparent"
|
||||
Header3FontSize="12"
|
||||
Header3FontWeight="Normal"
|
||||
Header3Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
IsTextSelectionEnabled="True"
|
||||
Text="{x:Bind Body, Mode=OneWay}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ internal sealed partial class TrayIconService
|
||||
_largeIcon = GetAppIconHandle();
|
||||
_trayIconData = new NOTIFYICONDATAW()
|
||||
{
|
||||
cbSize = (uint)Marshal.SizeOf<NOTIFYICONDATAW>(),
|
||||
cbSize = (uint)Marshal.SizeOf(typeof(NOTIFYICONDATAW)),
|
||||
hWnd = _hwnd,
|
||||
uID = MY_NOTIFY_ID,
|
||||
uFlags = NOTIFY_ICON_DATA_FLAGS.NIF_MESSAGE | NOTIFY_ICON_DATA_FLAGS.NIF_ICON | NOTIFY_ICON_DATA_FLAGS.NIF_TIP,
|
||||
@@ -133,7 +133,7 @@ internal sealed partial class TrayIconService
|
||||
|
||||
private DestroyIconSafeHandle GetAppIconHandle()
|
||||
{
|
||||
var exePath = Path.Combine(AppContext.BaseDirectory, "Microsoft.CmdPal.UI.exe");
|
||||
var exePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
|
||||
DestroyIconSafeHandle largeIcon;
|
||||
PInvoke.ExtractIconEx(exePath, 0, out largeIcon, out _, 1);
|
||||
return largeIcon;
|
||||
|
||||
@@ -496,18 +496,27 @@ public sealed partial class MainWindow : WindowEx,
|
||||
|
||||
if (key != null)
|
||||
{
|
||||
var vk = key.Code;
|
||||
var modifiers =
|
||||
(key.Alt ? HOT_KEY_MODIFIERS.MOD_ALT : 0) |
|
||||
(key.Ctrl ? HOT_KEY_MODIFIERS.MOD_CONTROL : 0) |
|
||||
(key.Shift ? HOT_KEY_MODIFIERS.MOD_SHIFT : 0) |
|
||||
(key.Win ? HOT_KEY_MODIFIERS.MOD_WIN : 0)
|
||||
;
|
||||
|
||||
var success = PInvoke.RegisterHotKey(_hwnd, _hotkeys.Count, modifiers, (uint)vk);
|
||||
if (success)
|
||||
if (settings.UseLowLevelGlobalHotkey)
|
||||
{
|
||||
_hotkeys.Add(commandHotkey);
|
||||
_keyboardListener.SetHotkeyAction(key.Win, key.Ctrl, key.Shift, key.Alt, (byte)key.Code, commandHotkey.CommandId);
|
||||
|
||||
_hotkeys.Add(new(globalHotkey, string.Empty));
|
||||
}
|
||||
else
|
||||
{
|
||||
var vk = key.Code;
|
||||
var modifiers =
|
||||
(key.Alt ? HOT_KEY_MODIFIERS.MOD_ALT : 0) |
|
||||
(key.Ctrl ? HOT_KEY_MODIFIERS.MOD_CONTROL : 0) |
|
||||
(key.Shift ? HOT_KEY_MODIFIERS.MOD_SHIFT : 0) |
|
||||
(key.Win ? HOT_KEY_MODIFIERS.MOD_WIN : 0)
|
||||
;
|
||||
|
||||
var success = PInvoke.RegisterHotKey(_hwnd, _hotkeys.Count, modifiers, (uint)vk);
|
||||
if (success)
|
||||
{
|
||||
_hotkeys.Add(commandHotkey);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,16 +23,6 @@
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SelfContained>true</SelfContained>
|
||||
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<PublishSingleFile>false</PublishSingleFile>
|
||||
<DisableRuntimeMarshalling>false</DisableRuntimeMarshalling>
|
||||
<PublishAot>true</PublishAot>
|
||||
<EnableMsixTooling>true</EnableMsixTooling>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<GenerateAppxPackageOnBuild>true</GenerateAppxPackageOnBuild>
|
||||
</PropertyGroup>
|
||||
@@ -81,6 +71,7 @@
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Converters" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Animations" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Extensions" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls.Markdown" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
|
||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" />
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" />
|
||||
@@ -99,6 +90,9 @@
|
||||
<PackageReference Include="System.Text.Json" />
|
||||
|
||||
<!-- LOAD BEARING: GeneratePathProperty=true on BOTH the AC dependencies. Don't forget the AdaptiveCardsWorkaround below -->
|
||||
<PackageReference Include="AdaptiveCards.ObjectModel.WinUI3" GeneratePathProperty="true" />
|
||||
<PackageReference Include="AdaptiveCards.Rendering.WinUI3" GeneratePathProperty="True" />
|
||||
<PackageReference Include="AdaptiveCards.Templating" />
|
||||
<PackageReference Include="System.Text.RegularExpressions" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -123,6 +117,7 @@
|
||||
|
||||
<ProjectReference Include="..\ext\Microsoft.CmdPal.Ext.Apps\Microsoft.CmdPal.Ext.Apps.csproj" />
|
||||
<ProjectReference Include="..\ext\Microsoft.CmdPal.Ext.Bookmark\Microsoft.CmdPal.Ext.Bookmarks.csproj" />
|
||||
<ProjectReference Include="..\ext\Microsoft.CmdPal.Ext.Calc\Microsoft.CmdPal.Ext.Calc.csproj" />
|
||||
<ProjectReference Include="..\ext\Microsoft.CmdPal.Ext.ClipboardHistory\Microsoft.CmdPal.Ext.ClipboardHistory.csproj" />
|
||||
<ProjectReference Include="..\ext\Microsoft.CmdPal.Ext.Registry\Microsoft.CmdPal.Ext.Registry.csproj" />
|
||||
<ProjectReference Include="..\ext\Microsoft.CmdPal.Ext.Shell\Microsoft.CmdPal.Ext.Shell.csproj" />
|
||||
@@ -132,7 +127,7 @@
|
||||
<ProjectReference Include="..\ext\Microsoft.CmdPal.Ext.WindowsTerminal\Microsoft.CmdPal.Ext.WindowsTerminal.csproj" />
|
||||
<ProjectReference Include="..\ext\Microsoft.CmdPal.Ext.WindowWalker\Microsoft.CmdPal.Ext.WindowWalker.csproj" />
|
||||
<ProjectReference Include="..\ext\Microsoft.CmdPal.Ext.WinGet\Microsoft.CmdPal.Ext.WinGet.csproj" />
|
||||
<ProjectReference Include="..\ext\Microsoft.CmdPal.Ext.Calc\Microsoft.CmdPal.Ext.Calc.csproj" />
|
||||
|
||||
<ProjectReference Include="..\Microsoft.Terminal.UI\Microsoft.Terminal.UI.vcxproj">
|
||||
<ReferenceOutputAssembly>True</ReferenceOutputAssembly>
|
||||
<Private>True</Private>
|
||||
@@ -186,6 +181,10 @@
|
||||
<PropertyGroup>
|
||||
<AdaptiveCardsNative>runtimes\win10-$(Platform)\native</AdaptiveCardsNative>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="$(PkgAdaptiveCards_ObjectModel_WinUI3)\$(AdaptiveCardsNative)\AdaptiveCards.ObjectModel.WinUI3.dll" Link="AdaptiveCards.ObjectModel.WinUI3.dll" CopyToOutputDirectory="PreserveNewest" />
|
||||
<Content Include="$(PkgAdaptiveCards_Rendering_WinUI3)\$(AdaptiveCardsNative)\AdaptiveCards.Rendering.WinUI3.dll" Link="AdaptiveCards.Rendering.WinUI3.dll" CopyToOutputDirectory="PreserveNewest" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Update="..\Microsoft.CmdPal.UI.ViewModels\Assets\template.zip">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
GetPhysicallyInstalledSystemMemory
|
||||
GlobalMemoryStatusEx
|
||||
GetSystemInfo
|
||||
CoCreateInstance
|
||||
GetForegroundWindow
|
||||
SetForegroundWindow
|
||||
GetWindowRect
|
||||
@@ -20,7 +21,10 @@ SetActiveWindow
|
||||
MonitorFromWindow
|
||||
GetMonitorInfo
|
||||
GetDpiForMonitor
|
||||
SHCreateStreamOnFileEx
|
||||
CoAllowSetForegroundWindow
|
||||
SHCreateStreamOnFileEx
|
||||
SHLoadIndirectString
|
||||
WM_HOTKEY
|
||||
WM_NCLBUTTONDBLCLK
|
||||
|
||||
@@ -29,6 +33,7 @@ LoadIcon
|
||||
WM_USER
|
||||
WM_WINDOWPOSCHANGING
|
||||
RegisterWindowMessageW
|
||||
GetModuleHandleW
|
||||
ExtractIconEx
|
||||
TRACK_POPUP_MENU_FLAGS
|
||||
WM_COMMAND
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:help="using:Microsoft.CmdPal.UI.Helpers"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:toolkit="using:CommunityToolkit.WinUI.UI.Controls"
|
||||
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||
xmlns:viewModels="using:Microsoft.CmdPal.UI.ViewModels"
|
||||
Background="Transparent"
|
||||
@@ -131,6 +132,13 @@
|
||||
Visibility="{x:Bind HasTags, Mode=OneWay}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<toolkit:WrapPanel
|
||||
x:Name="TagsWrapPanel"
|
||||
MinWidth="0"
|
||||
Padding="0"
|
||||
HorizontalSpacing="4"
|
||||
Orientation="Horizontal"
|
||||
VerticalSpacing="4" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
@@ -400,6 +408,16 @@
|
||||
TextWrapping="WrapWholeWords"
|
||||
Visibility="{x:Bind ViewModel.Details.Title, Converter={StaticResource StringNotEmptyToVisibilityConverter}, Mode=OneWay}" />
|
||||
|
||||
<toolkit:MarkdownTextBlock
|
||||
Grid.Row="2"
|
||||
Margin="0,12,0,24"
|
||||
Background="Transparent"
|
||||
Header3FontSize="12"
|
||||
Header3FontWeight="Normal"
|
||||
Header3Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
IsTextSelectionEnabled="True"
|
||||
Text="{x:Bind ViewModel.Details.Body, Mode=OneWay}" />
|
||||
|
||||
<ItemsRepeater
|
||||
Grid.Row="3"
|
||||
ItemTemplate="{StaticResource DetailsDataTemplateSelector}"
|
||||
|
||||
@@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<PublishSingleFile>False</PublishSingleFile>
|
||||
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
|
||||
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
|
||||
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">True</PublishTrimmed>
|
||||
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
|
||||
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
|
||||
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">False</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -39,8 +39,8 @@ Projects of interest are:
|
||||
|
||||
|
||||
[Initial SDK Spec]: ./doc/initial-sdk-spec/initial-sdk-spec.md
|
||||
[generic samples]: ./Exts/SamplePagesExtension
|
||||
[real samples]: ./Exts/ProcessMonitorExtension
|
||||
[generic samples]: ./ext/SamplePagesExtension
|
||||
[real samples]: ./ext/ProcessMonitorExtension
|
||||
[real extensions that we've "shipped" already]: https://github.com/zadjii/CmdPalExtensions/blob/main/src/extensions
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
using CmdPalCalculator;
|
||||
using CalculatorEngineCommon;
|
||||
using Windows.Foundation.Collections;
|
||||
|
||||
namespace Microsoft.CmdPal.Ext.Calc.Helper;
|
||||
@@ -83,6 +83,9 @@ public static class CalculateEngine
|
||||
}
|
||||
|
||||
var decimalResult = Convert.ToDecimal(result, cultureInfo);
|
||||
|
||||
// Remove trailing zeros from the decimal string representation (e.g., "1.2300" -> "1.23")
|
||||
// This is necessary because the value extracted from exprtk may contain unnecessary trailing zeros.
|
||||
var formatted = decimalResult.ToString("G29", cultureInfo);
|
||||
decimalResult = Convert.ToDecimal(formatted, cultureInfo);
|
||||
var roundedResult = Round(decimalResult);
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Common.Dotnet.CsWinRT.props" />
|
||||
<Import Project="..\..\..\..\Common.Dotnet.AotCompatibility.props" />
|
||||
<Target Name="BuildCmdPalCalculator" BeforeTargets="Build">
|
||||
<MSBuild
|
||||
Projects="..\..\CmdPalCalculator\CmdPalCalculator.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="Configuration=$(Configuration);Platform=$(Platform)" />
|
||||
</Target>
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Microsoft.CmdPal.Ext.Calc</RootNamespace>
|
||||
<OutputPath>$(SolutionDir)$(Platform)\$(Configuration)\WinUI3Apps\CmdPal</OutputPath>
|
||||
@@ -16,25 +10,24 @@
|
||||
<ProjectPriFileName>Microsoft.CmdPal.Ext.Calc.pri</ProjectPriFileName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<CsWinRTIncludes>CmdPalCalculator</CsWinRTIncludes>
|
||||
<CsWinRTIncludes>CalculatorEngineCommon</CsWinRTIncludes>
|
||||
<CsWinRTGeneratedFilesDir>$(OutDir)</CsWinRTGeneratedFilesDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\common\CalculatorEngineCommon\CalculatorEngineCommon.vcxproj" />
|
||||
<ProjectReference Include="..\..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
|
||||
<ProjectReference Include="..\..\extensionsdk\Microsoft.CommandPalette.Extensions.Toolkit\Microsoft.CommandPalette.Extensions.Toolkit.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<CsWinRTInputs Include="..\..\..\..\..\$(Platform)\$(Configuration)\CmdPalCalculator.winmd" />
|
||||
<Content Include="..\..\..\..\..\$(Platform)\$(Configuration)\CmdPalCalculator.winmd" Link="CmdPalCalculator.winmd">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\..\..\..\..\$(Platform)\$(Configuration)\CmdPalCalculator.dll">
|
||||
<CsWinRTInputs Include="..\..\..\..\..\$(Platform)\$(Configuration)\CalculatorEngineCommon.winmd" />
|
||||
<Content Include="..\..\..\..\..\$(Platform)\$(Configuration)\CalculatorEngineCommon.winmd" Link="CalculatorEngineCommon.winmd">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\..\..\..\..\$(Platform)\$(Configuration)\CalculatorEngineCommon.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
|
||||
@@ -31,57 +31,81 @@ internal sealed partial class WindowsSettingsListPage : DynamicListPage
|
||||
}
|
||||
|
||||
var filteredList = _windowsSettings.Settings
|
||||
.Where(Predicate)
|
||||
.OrderBy(found => found.Name);
|
||||
.Select(SearchScoringPredicate)
|
||||
.Where(scoredSetting => scoredSetting.Score > 0)
|
||||
.OrderByDescending(scoredSetting => scoredSetting.Score)
|
||||
.Select(scoredSetting => scoredSetting.Setting);
|
||||
|
||||
var newList = ResultHelper.GetResultList(filteredList, query);
|
||||
return newList;
|
||||
|
||||
bool Predicate(WindowsSetting found)
|
||||
// Rank settings by how they matched the search query. Order is:
|
||||
// 1. Exact Name (10 points)
|
||||
// 2. Name Starts With (8 points)
|
||||
// 3. Name (5 points)
|
||||
// 4. Area (4 points)
|
||||
// 5. AltName (2 points)
|
||||
// 6. Settings path (1 point)
|
||||
(WindowsSetting Setting, int Score) SearchScoringPredicate(WindowsSetting setting)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(query))
|
||||
{
|
||||
// If no search string is entered skip query comparison.
|
||||
return true;
|
||||
return (setting, 0);
|
||||
}
|
||||
|
||||
if (found.Name.Contains(query, StringComparison.CurrentCultureIgnoreCase))
|
||||
if (string.Equals(setting.Name, query, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
return (setting, 10);
|
||||
}
|
||||
|
||||
if (!(found.Areas is null))
|
||||
if (setting.Name.StartsWith(query, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
foreach (var area in found.Areas)
|
||||
return (setting, 8);
|
||||
}
|
||||
|
||||
if (setting.Name.Contains(query, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
return (setting, 5);
|
||||
}
|
||||
|
||||
if (!(setting.Areas is null))
|
||||
{
|
||||
foreach (var area in setting.Areas)
|
||||
{
|
||||
// Search for areas on normal queries.
|
||||
if (area.Contains(query, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
return (setting, 4);
|
||||
}
|
||||
|
||||
// Search for Area only on queries with action char.
|
||||
if (area.Contains(query.Replace(":", string.Empty), StringComparison.CurrentCultureIgnoreCase)
|
||||
&& query.EndsWith(":", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
return (setting, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!(found.AltNames is null))
|
||||
if (!(setting.AltNames is null))
|
||||
{
|
||||
foreach (var altName in found.AltNames)
|
||||
foreach (var altName in setting.AltNames)
|
||||
{
|
||||
if (altName.Contains(query, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
return (setting, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Search by key char '>' for app name and settings path
|
||||
return query.Contains('>') ? ResultHelper.FilterBySettingsPath(found, query) : false;
|
||||
if (query.Contains('>') && ResultHelper.FilterBySettingsPath(setting, query))
|
||||
{
|
||||
return (setting, 1);
|
||||
}
|
||||
|
||||
return (setting, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ public class ThumbnailHelper
|
||||
private static nint GetLargestIcon(string path)
|
||||
{
|
||||
var shinfo = default(NativeMethods.SHFILEINFO);
|
||||
NativeMethods.SHGetFileInfo(path, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), SHGFI_ICON | SHGFI_SYSICONINDEX);
|
||||
NativeMethods.SHGetFileInfo(path, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), SHGFI_SYSICONINDEX);
|
||||
|
||||
var hIcon = IntPtr.Zero;
|
||||
var iID_IImageList = new Guid("46EB5926-582E-4017-9FDF-E8998DAA0950");
|
||||
|
||||
@@ -107,21 +107,14 @@ namespace ColorPicker.Helpers
|
||||
}
|
||||
}
|
||||
|
||||
public void OnColorPickerMouseDown()
|
||||
public void OpenColorEditor()
|
||||
{
|
||||
if (_userSettings.ActivationAction.Value == ColorPickerActivationAction.OpenColorPickerAndThenEditor || _userSettings.ActivationAction.Value == ColorPickerActivationAction.OpenEditor)
|
||||
lock (_colorPickerVisibilityLock)
|
||||
{
|
||||
lock (_colorPickerVisibilityLock)
|
||||
{
|
||||
HideColorPicker();
|
||||
}
|
||||
HideColorPicker();
|
||||
}
|
||||
|
||||
ShowColorPickerEditor();
|
||||
}
|
||||
else
|
||||
{
|
||||
EndUserSession();
|
||||
}
|
||||
ShowColorPickerEditor();
|
||||
}
|
||||
|
||||
public static void SetTopMost()
|
||||
|
||||
@@ -16,10 +16,12 @@ namespace ColorPicker.Mouse
|
||||
// position and bool indicating zoom in or zoom out
|
||||
event EventHandler<Tuple<System.Windows.Point, bool>> OnMouseWheel;
|
||||
|
||||
event MouseUpEventHandler OnMouseDown;
|
||||
event PrimaryMouseDownEventHandler OnPrimaryMouseDown;
|
||||
|
||||
event SecondaryMouseUpEventHandler OnSecondaryMouseUp;
|
||||
|
||||
event MiddleMouseDownEventHandler OnMiddleMouseDown;
|
||||
|
||||
System.Windows.Point CurrentPosition { get; }
|
||||
|
||||
Color CurrentColor { get; }
|
||||
|
||||
@@ -7,17 +7,18 @@ using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Input;
|
||||
|
||||
using ColorPicker.Helpers;
|
||||
using ManagedCommon;
|
||||
|
||||
using static ColorPicker.NativeMethods;
|
||||
|
||||
namespace ColorPicker.Mouse
|
||||
{
|
||||
public delegate void MouseUpEventHandler(object sender, System.Drawing.Point p);
|
||||
public delegate void PrimaryMouseDownEventHandler(object sender, IntPtr wParam);
|
||||
|
||||
public delegate void SecondaryMouseUpEventHandler(object sender, IntPtr wParam);
|
||||
|
||||
public delegate void MiddleMouseDownEventHandler(object sender, IntPtr wParam);
|
||||
|
||||
internal class MouseHook
|
||||
{
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1310:Field names should not contain underscore", Justification = "Interop object")]
|
||||
@@ -30,23 +31,25 @@ namespace ColorPicker.Mouse
|
||||
private const int WM_RBUTTONUP = 0x0205;
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1310:Field names should not contain underscore", Justification = "Interop object")]
|
||||
private const int WM_RBUTTONDOWN = 0x0204;
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1310:Field names should not contain underscore", Justification = "Interop object")]
|
||||
private const int WM_MBUTTONDOWN = 0x0207;
|
||||
|
||||
private IntPtr _mouseHookHandle;
|
||||
private HookProc _mouseDelegate;
|
||||
|
||||
private event MouseUpEventHandler MouseDown;
|
||||
private event PrimaryMouseDownEventHandler PrimaryMouseDown;
|
||||
|
||||
public event MouseUpEventHandler OnMouseDown
|
||||
public event PrimaryMouseDownEventHandler OnPrimaryMouseDown
|
||||
{
|
||||
add
|
||||
{
|
||||
Subscribe();
|
||||
MouseDown += value;
|
||||
PrimaryMouseDown += value;
|
||||
}
|
||||
|
||||
remove
|
||||
{
|
||||
MouseDown -= value;
|
||||
PrimaryMouseDown -= value;
|
||||
Unsubscribe();
|
||||
}
|
||||
}
|
||||
@@ -68,6 +71,23 @@ namespace ColorPicker.Mouse
|
||||
}
|
||||
}
|
||||
|
||||
private event MiddleMouseDownEventHandler MiddleMouseDown;
|
||||
|
||||
public event MiddleMouseDownEventHandler OnMiddleMouseDown
|
||||
{
|
||||
add
|
||||
{
|
||||
Subscribe();
|
||||
MiddleMouseDown += value;
|
||||
}
|
||||
|
||||
remove
|
||||
{
|
||||
MiddleMouseDown -= value;
|
||||
Unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
private event MouseWheelEventHandler MouseWheel;
|
||||
|
||||
public event MouseWheelEventHandler OnMouseWheel
|
||||
@@ -126,9 +146,9 @@ namespace ColorPicker.Mouse
|
||||
MSLLHOOKSTRUCT mouseHookStruct = (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT));
|
||||
if (wParam.ToInt32() == WM_LBUTTONDOWN)
|
||||
{
|
||||
if (MouseDown != null)
|
||||
if (PrimaryMouseDown != null)
|
||||
{
|
||||
MouseDown.Invoke(null, new System.Drawing.Point(mouseHookStruct.pt.x, mouseHookStruct.pt.y));
|
||||
PrimaryMouseDown.Invoke(null, wParam);
|
||||
}
|
||||
|
||||
return new IntPtr(-1);
|
||||
@@ -150,6 +170,16 @@ namespace ColorPicker.Mouse
|
||||
return new IntPtr(-1);
|
||||
}
|
||||
|
||||
if (wParam.ToInt32() == WM_MBUTTONDOWN)
|
||||
{
|
||||
if (MiddleMouseDown != null)
|
||||
{
|
||||
MiddleMouseDown.Invoke(null, wParam);
|
||||
}
|
||||
|
||||
return new IntPtr(-1);
|
||||
}
|
||||
|
||||
if (wParam.ToInt32() == WM_MOUSEWHEEL)
|
||||
{
|
||||
if (MouseWheel != null)
|
||||
|
||||
@@ -56,10 +56,12 @@ namespace ColorPicker.Mouse
|
||||
|
||||
public event EventHandler<Tuple<System.Windows.Point, bool>> OnMouseWheel;
|
||||
|
||||
public event MouseUpEventHandler OnMouseDown;
|
||||
public event PrimaryMouseDownEventHandler OnPrimaryMouseDown;
|
||||
|
||||
public event SecondaryMouseUpEventHandler OnSecondaryMouseUp;
|
||||
|
||||
public event MiddleMouseDownEventHandler OnMiddleMouseDown;
|
||||
|
||||
public System.Windows.Point CurrentPosition
|
||||
{
|
||||
get
|
||||
@@ -148,9 +150,10 @@ namespace ColorPicker.Mouse
|
||||
_timer.Start();
|
||||
}
|
||||
|
||||
_mouseHook.OnMouseDown += MouseHook_OnMouseDown;
|
||||
_mouseHook.OnPrimaryMouseDown += MouseHook_OnPrimaryMouseDown;
|
||||
_mouseHook.OnMouseWheel += MouseHook_OnMouseWheel;
|
||||
_mouseHook.OnSecondaryMouseUp += MouseHook_OnSecondaryMouseUp;
|
||||
_mouseHook.OnMiddleMouseDown += MouseHook_OnMiddleMouseDown;
|
||||
|
||||
if (_userSettings.ChangeCursor.Value)
|
||||
{
|
||||
@@ -169,10 +172,10 @@ namespace ColorPicker.Mouse
|
||||
OnMouseWheel?.Invoke(this, new Tuple<System.Windows.Point, bool>(_previousMousePosition, zoomIn));
|
||||
}
|
||||
|
||||
private void MouseHook_OnMouseDown(object sender, Point p)
|
||||
private void MouseHook_OnPrimaryMouseDown(object sender, IntPtr wParam)
|
||||
{
|
||||
DisposeHook();
|
||||
OnMouseDown?.Invoke(this, p);
|
||||
OnPrimaryMouseDown?.Invoke(this, wParam);
|
||||
}
|
||||
|
||||
private void MouseHook_OnSecondaryMouseUp(object sender, IntPtr wParam)
|
||||
@@ -181,6 +184,12 @@ namespace ColorPicker.Mouse
|
||||
OnSecondaryMouseUp?.Invoke(this, wParam);
|
||||
}
|
||||
|
||||
private void MouseHook_OnMiddleMouseDown(object sender, IntPtr wParam)
|
||||
{
|
||||
DisposeHook();
|
||||
OnMiddleMouseDown?.Invoke(this, wParam);
|
||||
}
|
||||
|
||||
private void CopiedColorRepresentation_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
_colorFormatChanged = true;
|
||||
@@ -194,9 +203,10 @@ namespace ColorPicker.Mouse
|
||||
}
|
||||
|
||||
_previousMousePosition = new System.Windows.Point(-1, 1);
|
||||
_mouseHook.OnMouseDown -= MouseHook_OnMouseDown;
|
||||
_mouseHook.OnPrimaryMouseDown -= MouseHook_OnPrimaryMouseDown;
|
||||
_mouseHook.OnMouseWheel -= MouseHook_OnMouseWheel;
|
||||
_mouseHook.OnSecondaryMouseUp -= MouseHook_OnSecondaryMouseUp;
|
||||
_mouseHook.OnMiddleMouseDown -= MouseHook_OnMiddleMouseDown;
|
||||
|
||||
if (_userSettings.ChangeCursor.Value)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,12 @@ namespace ColorPicker.Settings
|
||||
|
||||
SettingItem<ColorPickerActivationAction> ActivationAction { get; }
|
||||
|
||||
SettingItem<ColorPickerClickAction> PrimaryClickAction { get; }
|
||||
|
||||
SettingItem<ColorPickerClickAction> MiddleClickAction { get; }
|
||||
|
||||
SettingItem<ColorPickerClickAction> SecondaryClickAction { get; }
|
||||
|
||||
RangeObservableCollection<string> ColorHistory { get; }
|
||||
|
||||
SettingItem<int> ColorHistoryLimit { get; }
|
||||
|
||||
@@ -49,7 +49,10 @@ namespace ColorPicker.Settings
|
||||
ChangeCursor = new SettingItem<bool>(true);
|
||||
ActivationShortcut = new SettingItem<string>(DefaultActivationShortcut);
|
||||
CopiedColorRepresentation = new SettingItem<string>(ColorRepresentationType.HEX.ToString());
|
||||
ActivationAction = new SettingItem<ColorPickerActivationAction>(ColorPickerActivationAction.OpenEditor);
|
||||
ActivationAction = new SettingItem<ColorPickerActivationAction>(ColorPickerActivationAction.OpenColorPicker);
|
||||
PrimaryClickAction = new SettingItem<ColorPickerClickAction>(ColorPickerClickAction.PickColorThenEditor);
|
||||
MiddleClickAction = new SettingItem<ColorPickerClickAction>(ColorPickerClickAction.PickColorAndClose);
|
||||
SecondaryClickAction = new SettingItem<ColorPickerClickAction>(ColorPickerClickAction.Close);
|
||||
ColorHistoryLimit = new SettingItem<int>(20);
|
||||
ColorHistory.CollectionChanged += ColorHistory_CollectionChanged;
|
||||
ShowColorName = new SettingItem<bool>(false);
|
||||
@@ -78,6 +81,12 @@ namespace ColorPicker.Settings
|
||||
|
||||
public SettingItem<ColorPickerActivationAction> ActivationAction { get; private set; }
|
||||
|
||||
public SettingItem<ColorPickerClickAction> PrimaryClickAction { get; private set; }
|
||||
|
||||
public SettingItem<ColorPickerClickAction> MiddleClickAction { get; private set; }
|
||||
|
||||
public SettingItem<ColorPickerClickAction> SecondaryClickAction { get; private set; }
|
||||
|
||||
public RangeObservableCollection<string> ColorHistory { get; private set; } = new RangeObservableCollection<string>();
|
||||
|
||||
public SettingItem<int> ColorHistoryLimit { get; }
|
||||
@@ -121,6 +130,9 @@ namespace ColorPicker.Settings
|
||||
CopiedColorRepresentation.Value = settings.Properties.CopiedColorRepresentation;
|
||||
CopiedColorRepresentationFormat = new SettingItem<string>(string.Empty);
|
||||
ActivationAction.Value = settings.Properties.ActivationAction;
|
||||
PrimaryClickAction.Value = settings.Properties.PrimaryClickAction;
|
||||
MiddleClickAction.Value = settings.Properties.MiddleClickAction;
|
||||
SecondaryClickAction.Value = settings.Properties.SecondaryClickAction;
|
||||
ColorHistoryLimit.Value = settings.Properties.ColorHistoryLimit;
|
||||
ShowColorName.Value = settings.Properties.ShowColorName;
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ using ColorPicker.Settings;
|
||||
using ColorPicker.ViewModelContracts;
|
||||
using Common.UI;
|
||||
using ManagedCommon;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Enumerations;
|
||||
using PowerToys.Interop;
|
||||
|
||||
namespace ColorPicker.ViewModels
|
||||
@@ -79,9 +80,10 @@ namespace ColorPicker.ViewModels
|
||||
{
|
||||
SetColorDetails(mouseInfoProvider.CurrentColor);
|
||||
mouseInfoProvider.MouseColorChanged += Mouse_ColorChanged;
|
||||
mouseInfoProvider.OnMouseDown += MouseInfoProvider_OnMouseDown;
|
||||
mouseInfoProvider.OnPrimaryMouseDown += MouseInfoProvider_OnPrimaryMouseDown;
|
||||
mouseInfoProvider.OnMouseWheel += MouseInfoProvider_OnMouseWheel;
|
||||
mouseInfoProvider.OnSecondaryMouseUp += MouseInfoProvider_OnSecondaryMouseUp;
|
||||
mouseInfoProvider.OnMiddleMouseDown += MouseInfoProvider_OnMiddleMouseDown;
|
||||
}
|
||||
|
||||
_userSettings.ShowColorName.PropertyChanged += (s, e) => { OnPropertyChanged(nameof(ShowColorName)); };
|
||||
@@ -113,7 +115,7 @@ namespace ColorPicker.ViewModels
|
||||
|
||||
private void AppStateHandler_EnterPressed(object sender, EventArgs e)
|
||||
{
|
||||
MouseInfoProvider_OnMouseDown(null, default(System.Drawing.Point));
|
||||
MouseInfoProvider_OnPrimaryMouseDown(null, default);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -167,18 +169,50 @@ namespace ColorPicker.ViewModels
|
||||
SetColorDetails(color);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tell the color picker that the user have press a mouse button (after release the button)
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender of this event</param>
|
||||
/// <param name="p">The current <see cref="System.Drawing.Point"/> of the mouse cursor</param>
|
||||
private void MouseInfoProvider_OnMouseDown(object sender, System.Drawing.Point p)
|
||||
private void MouseInfoProvider_OnPrimaryMouseDown(object sender, IntPtr wParam)
|
||||
{
|
||||
ClipboardHelper.CopyToClipboard(ColorText);
|
||||
HandleMouseClickAction(_userSettings.PrimaryClickAction.Value);
|
||||
}
|
||||
|
||||
var color = GetColorString();
|
||||
private void MouseInfoProvider_OnMiddleMouseDown(object sender, IntPtr wParam)
|
||||
{
|
||||
HandleMouseClickAction(_userSettings.MiddleClickAction.Value);
|
||||
}
|
||||
|
||||
var oldIndex = _userSettings.ColorHistory.IndexOf(color);
|
||||
private void MouseInfoProvider_OnSecondaryMouseUp(object sender, IntPtr wParam)
|
||||
{
|
||||
HandleMouseClickAction(_userSettings.SecondaryClickAction.Value);
|
||||
}
|
||||
|
||||
private void HandleMouseClickAction(ColorPickerClickAction action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ColorPickerClickAction.PickColorThenEditor:
|
||||
ClipboardHelper.CopyToClipboard(ColorText);
|
||||
UpdateColorHistory(GetColorString());
|
||||
|
||||
_appStateHandler.OpenColorEditor();
|
||||
|
||||
break;
|
||||
|
||||
case ColorPickerClickAction.PickColorAndClose:
|
||||
ClipboardHelper.CopyToClipboard(ColorText);
|
||||
UpdateColorHistory(GetColorString());
|
||||
|
||||
_appStateHandler.EndUserSession();
|
||||
|
||||
break;
|
||||
|
||||
case ColorPickerClickAction.Close:
|
||||
_appStateHandler.EndUserSession();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateColorHistory(string color)
|
||||
{
|
||||
int oldIndex = _userSettings.ColorHistory.IndexOf(color);
|
||||
if (oldIndex != -1)
|
||||
{
|
||||
_userSettings.ColorHistory.Move(oldIndex, 0);
|
||||
@@ -192,13 +226,6 @@ namespace ColorPicker.ViewModels
|
||||
{
|
||||
_userSettings.ColorHistory.RemoveAt(_userSettings.ColorHistory.Count - 1);
|
||||
}
|
||||
|
||||
_appStateHandler.OnColorPickerMouseDown();
|
||||
}
|
||||
|
||||
private void MouseInfoProvider_OnSecondaryMouseUp(object sender, IntPtr wParam)
|
||||
{
|
||||
_appStateHandler.EndUserSession();
|
||||
}
|
||||
|
||||
private string GetColorString()
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
"org": "microsoft",
|
||||
"project": "OS",
|
||||
"AssignedTo": "mengyuanchen@microsoft.com",
|
||||
"AreaPath": "OS\\Windows Client and Services\\WinPD\\DEEP-Developer Experience, Ecosystem and Partnerships\\SHINE\\PowerToys",
|
||||
"AreaPath": "OS\\Windows Client and Services\\WinPD\\DFX-Developer Fundamentals and Experiences\\DEFT\\SALT",
|
||||
"IterationPath": "OS\\Future"
|
||||
},
|
||||
"jobNotificationEmail": "mengyuanchen@microsoft.com",
|
||||
"jobNotificationEmail": "PowerToys@microsoft.com",
|
||||
"skip": false,
|
||||
"rebootAfterSetup": false,
|
||||
"oneFuzzJobs": [
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">System</dpiAwareness>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
|
||||
|
||||
@@ -14,25 +14,7 @@ namespace PowerLauncher.Helper
|
||||
{
|
||||
public static class ErrorReporting
|
||||
{
|
||||
private static void Report(Exception e, bool waitForClose)
|
||||
{
|
||||
if (e != null)
|
||||
{
|
||||
var logger = LogManager.GetLogger("UnHandledException");
|
||||
logger.Fatal(ExceptionFormatter.FormatException(e));
|
||||
|
||||
var reportWindow = new ReportWindow(e);
|
||||
|
||||
if (waitForClose)
|
||||
{
|
||||
reportWindow.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
reportWindow.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
private const string LoggerName = "UnHandledException";
|
||||
|
||||
public static void ShowMessageBox(string title, string message)
|
||||
{
|
||||
@@ -47,17 +29,20 @@ namespace PowerLauncher.Helper
|
||||
// handle non-ui thread exceptions
|
||||
System.Windows.Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
Report((Exception)e?.ExceptionObject, true);
|
||||
HandleException(e?.ExceptionObject as Exception, true);
|
||||
});
|
||||
}
|
||||
|
||||
public static void DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||
{
|
||||
// handle ui thread exceptions
|
||||
Report(e?.Exception, false);
|
||||
if (e != null)
|
||||
{
|
||||
// handle ui thread exceptions
|
||||
HandleException(e.Exception, false);
|
||||
|
||||
// prevent application exist, so the user can copy prompted error info
|
||||
e.Handled = true;
|
||||
// prevent application exist, so the user can copy prompted error info
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static string RuntimeInfo()
|
||||
@@ -68,5 +53,60 @@ namespace PowerLauncher.Helper
|
||||
$"\nx64: {Environment.Is64BitOperatingSystem}";
|
||||
return info;
|
||||
}
|
||||
|
||||
private static void HandleException(Exception e, bool isNotUIThread)
|
||||
{
|
||||
// The crash occurs in PresentationFramework.dll, not necessarily when the Runner UI is visible, originating from this line:
|
||||
// https://github.com/dotnet/wpf/blob/3439f20fb8c685af6d9247e8fd2978cac42e74ac/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Shell/WindowChromeWorker.cs#L1005
|
||||
// Many bug reports because users see the "Report problem UI" after "the" crash with System.Runtime.InteropServices.COMException 0xD0000701 or 0x80263001.
|
||||
// However, displaying this "Report problem UI" during WPF crashes, especially when DWM composition is changing, is not ideal; some users reported it hangs for up to a minute before the "Report problem UI" appears.
|
||||
// This change modifies the behavior to log the exception instead of showing the "Report problem UI".
|
||||
if (IsDwmCompositionException(e as System.Runtime.InteropServices.COMException))
|
||||
{
|
||||
var logger = LogManager.GetLogger(LoggerName);
|
||||
logger.Error($"From {(isNotUIThread ? "non" : string.Empty)} UI thread's exception: {ExceptionFormatter.FormatException(e)}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Report(e, isNotUIThread);
|
||||
}
|
||||
}
|
||||
|
||||
private static void Report(Exception e, bool waitForClose)
|
||||
{
|
||||
if (e != null)
|
||||
{
|
||||
var logger = LogManager.GetLogger(LoggerName);
|
||||
logger.Fatal($"From {(waitForClose ? "non" : string.Empty)} UI thread's exception: {ExceptionFormatter.FormatException(e)}");
|
||||
|
||||
var reportWindow = new ReportWindow(e);
|
||||
|
||||
if (waitForClose)
|
||||
{
|
||||
reportWindow.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
reportWindow.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsDwmCompositionException(System.Runtime.InteropServices.COMException comException)
|
||||
{
|
||||
if (comException == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var stackTrace = comException.StackTrace;
|
||||
if (string.IsNullOrEmpty(stackTrace))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check for common DWM composition changed patterns in the stack trace
|
||||
return stackTrace.Contains("DwmCompositionChanged");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user