fix spellchecker

This commit is contained in:
Jaime Bernardo
2022-08-03 15:31:13 +01:00
parent cd10bf3ae6
commit 6564a4f427
11 changed files with 82 additions and 53 deletions

View File

@@ -153,9 +153,11 @@ bigbar
bigobj
binlog
bitmapimage
BITMAPFILEHEADER
BITMAPINFO
BITMAPINFOHEADER
bitmask
BITSPIXEL
bla
Blockquotes
blog
@@ -261,6 +263,7 @@ CMINVOKECOMMANDINFOEX
CMock
CMONITORS
cmp
cmpgt
cmyk
cnt
Cocklebiddy
@@ -362,6 +365,7 @@ customaction
CUSTOMACTIONTEST
cvd
CVirtual
cvtsi
cwchar
cwd
cxfksword
@@ -388,11 +392,14 @@ Dbg
Dbghelp
DBLCLKS
DBLEPSILON
DCapture
DCOM
dcomp
dcompi
DComposition
DDevice
ddf
DDxgi
Deact
debian
debugbreak
@@ -518,6 +525,7 @@ EFile
ekus
elif
elseif
emmintrin
Emoji
emptyrecyclebin
ENABLEDPOPUP
@@ -534,6 +542,7 @@ enum
EOAC
EOL
epicgames
epu
Eqn
ERASEBKGND
EREOF
@@ -656,12 +665,15 @@ GETMINMAXINFO
GETSTATE
GETTEXT
GETTEXTLENGTH
GHND
github
githubusercontent
globals
GMEM
GNumber
google
GPTR
gpu
GSM
gtm
gui
@@ -742,6 +754,7 @@ hotkeys
hotlight
hotspot
Hovd
HPALETTE
HPAINTBUFFER
HRAWINPUT
hread
@@ -798,6 +811,7 @@ IDD
IDelayed
IDesktop
IDictionary
IDirect
IDirectory
IDispatch
IDispatcher
@@ -833,6 +847,7 @@ IFolder
IFormat
ifstream
IGraph
IGraphics
iid
IImage
Iindex
@@ -1105,6 +1120,7 @@ lookbehind
lowlevel
LOWORD
lparam
LPBITMAPINFOHEADER
LPBYTE
LPCITEMIDLIST
LPCMINVOKECOMMANDINFO
@@ -1786,6 +1802,7 @@ SETTINGCHANGE
settingsheader
settingshotkeycontrol
SETWORKAREA
setzero
sfgao
SFGAOF
SFP
@@ -1953,6 +1970,7 @@ subkey
SUBLANG
submenu
subquery
subresource
substr
Sul
Superbar
@@ -2103,6 +2121,7 @@ undef
UNDNAME
unescape
Unicast
UNICODETEXT
Unindent
Uninitialize
uninstall
@@ -2151,15 +2170,18 @@ Uvs
uwp
uxtheme
UYVY
vabdq
validmodulename
vcamp
vcdl
VCINSTALLDIR
vcm
Vcpkg
VCRT
vcvars
VDesktop
vdi
vdupq
vec
VERBSONLY
VERBW
@@ -2169,6 +2191,7 @@ VERSIONINFO
Versioning
vformat
VFT
vgetq
vid
VIDCAP
videoconference
@@ -2184,15 +2207,20 @@ visualbrush
visualstudio
VKey
VKTAB
vorrq
VOS
vpaddlq
Vpn
vqsubq
VREDRAW
vreinterpretq
VSC
VSCBD
vscdb
vscode
vsconfig
VSCROLL
vsetq
vsonline
vstemplate
VSTHRD
@@ -2352,6 +2380,7 @@ XLoc
XNamespace
XOffset
xpath
XPixel
XResource
xsi
XStr

View File

@@ -945,8 +945,8 @@
</Component>
<?foreach File in $(var.MeasureToolFiles)?>
<Component Id="MSRET_$(var.File)" Win64="yes">
<File Id="MSRET_$(var.File)" Source="$(var.BinDir)modules\$(var.MeasureToolProjectName)\$(var.File)" />
<Component Id="MEASURE_TOOL_$(var.File)" Win64="yes">
<File Id="MEASURE_TOOL_$(var.File)" Source="$(var.BinDir)modules\$(var.MeasureToolProjectName)\$(var.File)" />
</Component>
<?endforeach?>
@@ -1092,7 +1092,7 @@
<ComponentRef Id="Module_AlwaysOnTopInterface"/>
<ComponentRef Id="Module_MeasureToolInterface"/>
<?foreach File in $(var.MeasureToolFiles)?>
<ComponentRef Id="MSRET_$(var.File)" />
<ComponentRef Id="MEASURE_TOOL_$(var.File)" />
<?endforeach?>
<?foreach File in $(var.SettingsV2Files)?>

View File

@@ -8,7 +8,7 @@ void BGRATextureView::SaveAsBitmap(const char* filename) const
wil::unique_hbitmap bitmap{ CreateBitmap(static_cast<int>(width), static_cast<int>(height), 1, 32, pixels) };
const HBITMAP hBitmap = bitmap.get();
DWORD dwPaletteSize = 0, dwBmBitsSize = 0, dwDIBSize = 0, dwWritten = 0;
LPBITMAPINFOHEADER lpbi;
LPBITMAPINFOHEADER lpBitmapInfo;
HANDLE hDib, hPal, hOldPal2 = NULL;
HDC hDC = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
const int iBits = GetDeviceCaps(hDC, BITSPIXEL) * GetDeviceCaps(hDC, PLANES);
@@ -33,8 +33,8 @@ void BGRATextureView::SaveAsBitmap(const char* filename) const
bi.biClrUsed = 256;
dwBmBitsSize = ((Bitmap0.bmWidth * wBitCount + 31) & ~31) / 8 * Bitmap0.bmHeight;
hDib = GlobalAlloc(GHND, dwBmBitsSize + dwPaletteSize + sizeof(BITMAPINFOHEADER));
lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDib);
*lpbi = bi;
lpBitmapInfo = (LPBITMAPINFOHEADER)GlobalLock(hDib);
*lpBitmapInfo = bi;
hPal = GetStockObject(DEFAULT_PALETTE);
if (hPal)
@@ -44,7 +44,7 @@ void BGRATextureView::SaveAsBitmap(const char* filename) const
RealizePalette(hDC);
}
GetDIBits(hDC, hBitmap, 0, (UINT)Bitmap0.bmHeight, (LPSTR)lpbi + sizeof(BITMAPINFOHEADER) + dwPaletteSize, (BITMAPINFO*)lpbi, DIB_RGB_COLORS);
GetDIBits(hDC, hBitmap, 0, (UINT)Bitmap0.bmHeight, (LPSTR)lpBitmapInfo + sizeof(BITMAPINFOHEADER) + dwPaletteSize, (BITMAPINFO*)lpBitmapInfo, DIB_RGB_COLORS);
if (hOldPal2)
{
@@ -58,15 +58,15 @@ void BGRATextureView::SaveAsBitmap(const char* filename) const
if (!fh)
return;
BITMAPFILEHEADER bmfHdr = {};
bmfHdr.bfType = 0x4D42; // "BM"
BITMAPFILEHEADER bitmapFileHeader = {};
bitmapFileHeader.bfType = 0x4D42; // "BM"
dwDIBSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + dwPaletteSize + dwBmBitsSize;
bmfHdr.bfSize = dwDIBSize;
bmfHdr.bfOffBits = (DWORD)sizeof(BITMAPFILEHEADER) + (DWORD)sizeof(BITMAPINFOHEADER) + dwPaletteSize;
bitmapFileHeader.bfSize = dwDIBSize;
bitmapFileHeader.bfOffBits = (DWORD)sizeof(BITMAPFILEHEADER) + (DWORD)sizeof(BITMAPINFOHEADER) + dwPaletteSize;
WriteFile(fh.get(), (LPSTR)&bmfHdr, sizeof(BITMAPFILEHEADER), &dwWritten, NULL);
WriteFile(fh.get(), (LPSTR)&bitmapFileHeader, sizeof(BITMAPFILEHEADER), &dwWritten, NULL);
WriteFile(fh.get(), (LPSTR)lpbi, dwDIBSize, &dwWritten, NULL);
WriteFile(fh.get(), (LPSTR)lpBitmapInfo, dwDIBSize, &dwWritten, NULL);
GlobalUnlock(hDib);
GlobalFree(hDib);
}

View File

@@ -84,14 +84,14 @@ struct BGRATextureView
{
const __m128i rgba1 = _mm_cvtsi32_si128(pixel1);
const __m128i rgba2 = _mm_cvtsi32_si128(pixel2);
const __m128i dists = distance_epi8(rgba1, rgba2);
const __m128i distances = distance_epi8(rgba1, rgba2);
// Method 1: Test whether each channel distance is not great than tolerance
//const __m128i tolrs = _mm_set1_epi8(tolerance);
//return _mm_cvtsi128_si32(_mm_cmpgt_epi8(dists, tolrs)) == 0;
//const __m128i tolerances = _mm_set1_epi8(tolerance);
//return _mm_cvtsi128_si32(_mm_cmpgt_epi8(distances, tolerances)) == 0;
// Method 2: Test whether sum of all channel differences is smaller than tolerance
return _mm_cvtsi128_si32(_mm_sad_epu8(dists, _mm_setzero_si128())) <= tolerance;
return _mm_cvtsi128_si32(_mm_sad_epu8(distances, _mm_setzero_si128())) <= tolerance;
}
#if !defined(NDEBUG)

View File

@@ -1,7 +1,7 @@
#pragma once
#include <windef.h>
#include <dcommon.h>
#include <dCommon.h>
#include <array>
#include <functional>

View File

@@ -345,8 +345,8 @@ void DrawBoundsToolOverlayUILoop(BoundsToolState& toolState, HWND overlayWindow)
void DrawMeasureToolOverlayUILoop(MeasureToolState& toolState, HWND overlayWindow)
{
bool drawHCrossLine = true;
bool drawVCrossLine = true;
bool drawHorizontalCrossLine = true;
bool drawVerticalCrossLine = true;
MeasureToolState::Mode toolMode;
D2D1::ColorF crossColor = D2D1::ColorF::OrangeRed;
@@ -357,16 +357,16 @@ void DrawMeasureToolOverlayUILoop(MeasureToolState& toolState, HWND overlayWindo
switch (s.mode)
{
case MeasureToolState::Mode::Cross:
drawHCrossLine = true;
drawVCrossLine = true;
drawHorizontalCrossLine = true;
drawVerticalCrossLine = true;
break;
case MeasureToolState::Mode::Vertical:
drawHCrossLine = false;
drawVCrossLine = true;
drawHorizontalCrossLine = false;
drawVerticalCrossLine = true;
break;
case MeasureToolState::Mode::Horizontal:
drawHCrossLine = true;
drawVCrossLine = false;
drawHorizontalCrossLine = true;
drawVerticalCrossLine = false;
break;
}
});
@@ -386,12 +386,12 @@ void DrawMeasureToolOverlayUILoop(MeasureToolState& toolState, HWND overlayWindo
const float CROSS_THICKNESS = 1.f * d2dState.dpiScale;
if (drawHCrossLine)
if (drawHorizontalCrossLine)
{
d2dState.rt->DrawLine(mts.cross.hLineStart, mts.cross.hLineEnd, d2dState.solidBrushes[Brush::line].get(), CROSS_THICKNESS);
}
if (drawVCrossLine)
if (drawVerticalCrossLine)
{
d2dState.rt->DrawLine(mts.cross.vLineStart, mts.cross.vLineEnd, d2dState.solidBrushes[Brush::line].get(), CROSS_THICKNESS);
}

View File

@@ -45,7 +45,7 @@ class D3DCaptureState final
{
winrt::com_ptr<ID3D11Device> d3dDevice;
winrt::IDirect3DDevice device;
winrt::com_ptr<IDXGISwapChain1> swapchain;
winrt::com_ptr<IDXGISwapChain1> swapChain;
winrt::com_ptr<ID3D11DeviceContext> context;
winrt::SizeInt32 frameSize;
@@ -57,7 +57,7 @@ class D3DCaptureState final
D3DCaptureState(winrt::com_ptr<ID3D11Device> d3dDevice,
winrt::IDirect3DDevice _device,
winrt::com_ptr<IDXGISwapChain1> _swapchain,
winrt::com_ptr<IDXGISwapChain1> _swapChain,
winrt::com_ptr<ID3D11DeviceContext> _context,
const winrt::GraphicsCaptureItem& item,
winrt::DirectXPixelFormat _pixelFormat);
@@ -68,7 +68,7 @@ class D3DCaptureState final
void StartSessionInPreferredMode();
std::mutex dtorMutex;
std::mutex destructorMutex;
public:
static std::unique_ptr<D3DCaptureState> Create(const winrt::GraphicsCaptureItem& item, const winrt::DirectXPixelFormat pixelFormat);
@@ -83,13 +83,13 @@ public:
D3DCaptureState::D3DCaptureState(winrt::com_ptr<ID3D11Device> _d3dDevice,
winrt::IDirect3DDevice _device,
winrt::com_ptr<IDXGISwapChain1> _swapchain,
winrt::com_ptr<IDXGISwapChain1> _swapChain,
winrt::com_ptr<ID3D11DeviceContext> _context,
const winrt::GraphicsCaptureItem& item,
winrt::DirectXPixelFormat _pixelFormat) :
d3dDevice{ std::move(_d3dDevice) },
device{ std::move(_device) },
swapchain{ std::move(_swapchain) },
swapChain{ std::move(_swapChain) },
context{ std::move(_context) },
frameSize{ item.Size() },
pixelFormat{ std::move(_pixelFormat) },
@@ -127,7 +127,7 @@ auto GetDXGIInterfaceFromObject(winrt::IInspectable const& object)
void D3DCaptureState::OnFrameArrived(const winrt::Direct3D11CaptureFramePool& sender, const winrt::IInspectable&)
{
// Prevent calling a callback on a partially destroyed state
std::unique_lock callbackLock{ dtorMutex };
std::unique_lock callbackLock{ destructorMutex };
bool resized = false;
winrt::com_ptr<ID3D11Texture2D> texture;
@@ -137,7 +137,7 @@ void D3DCaptureState::OnFrameArrived(const winrt::Direct3D11CaptureFramePool& se
if (auto newFrameSize = frame.ContentSize(); newFrameSize != frameSize)
{
winrt::check_hresult(swapchain->ResizeBuffers(2,
winrt::check_hresult(swapChain->ResizeBuffers(2,
static_cast<uint32_t>(newFrameSize.Height),
static_cast<uint32_t>(newFrameSize.Width),
static_cast<DXGI_FORMAT>(pixelFormat),
@@ -146,7 +146,7 @@ void D3DCaptureState::OnFrameArrived(const winrt::Direct3D11CaptureFramePool& se
resized = true;
}
winrt::check_hresult(swapchain->GetBuffer(0, winrt::guid_of<ID3D11Texture2D>(), texture.put_void()));
winrt::check_hresult(swapChain->GetBuffer(0, winrt::guid_of<ID3D11Texture2D>(), texture.put_void()));
auto gpuTexture = GetDXGIInterfaceFromObject<ID3D11Texture2D>(frame.Surface());
texture = CopyFrameToCPU(gpuTexture);
}
@@ -154,7 +154,7 @@ void D3DCaptureState::OnFrameArrived(const winrt::Direct3D11CaptureFramePool& se
OwnedTextureView textureView{ texture, context };
DXGI_PRESENT_PARAMETERS presentParameters = {};
swapchain->Present1(1, 0, &presentParameters);
swapChain->Present1(1, 0, &presentParameters);
frameCallback(std::move(textureView));
@@ -218,8 +218,8 @@ std::unique_ptr<D3DCaptureState> D3DCaptureState::Create(const winrt::GraphicsCa
winrt::com_ptr<IDXGIFactory2> factory;
winrt::check_hresult(adapter->GetParent(winrt::guid_of<IDXGIFactory2>(), factory.put_void()));
winrt::com_ptr<IDXGISwapChain1> swapchain;
winrt::check_hresult(factory->CreateSwapChainForComposition(d3dDevice.get(), &desc, nullptr, swapchain.put()));
winrt::com_ptr<IDXGISwapChain1> swapChain;
winrt::check_hresult(factory->CreateSwapChainForComposition(d3dDevice.get(), &desc, nullptr, swapChain.put()));
winrt::com_ptr<ID3D11DeviceContext> context;
d3dDevice->GetImmediateContext(context.put());
@@ -228,7 +228,7 @@ std::unique_ptr<D3DCaptureState> D3DCaptureState::Create(const winrt::GraphicsCa
// We must create the object in a heap, since we need to pin it in memory to receive callbacks
auto statePtr = new D3DCaptureState{ d3dDevice,
d3dDeviceInspectable.as<winrt::IDirect3DDevice>(),
std::move(swapchain),
std::move(swapChain),
std::move(context),
item,
pixelFormat };
@@ -238,7 +238,7 @@ std::unique_ptr<D3DCaptureState> D3DCaptureState::Create(const winrt::GraphicsCa
D3DCaptureState::~D3DCaptureState()
{
std::unique_lock callbackLock{ dtorMutex };
std::unique_lock callbackLock{ destructorMutex };
StopCapture();
framePool.Close();
}
@@ -343,8 +343,8 @@ void StartCapturingThread(MeasureToolState& state, HWND targetWindow, HMONITOR t
continuousCapture = state.continuousCapture;
});
constexpr size_t TARGET_FRAMERATE = 120;
constexpr auto TARGET_FRAME_DURATION = std::chrono::milliseconds{ 1000 } / TARGET_FRAMERATE;
constexpr size_t TARGET_FRAME_RATE = 120;
constexpr auto TARGET_FRAME_DURATION = std::chrono::milliseconds{ 1000 } / TARGET_FRAME_RATE;
if (continuousCapture)
{

View File

@@ -10,7 +10,7 @@
#include <d2d1_3.h>
#include <dwrite.h>
#include <dwmapi.h>
#include <windows.graphics.directx.direct3d11.interop.h>
#include <windows.graphics.directX.direct3d11.interop.h>
#include <windows.graphics.capture.interop.h>
#include <windows.graphics.capture.h>

View File

@@ -1,4 +1,4 @@
<winex:WindowEx
<winuiex:WindowEx
x:Class="MeasureToolUI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@@ -7,7 +7,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:MeasureToolUI"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:winex="using:WinUIEx"
xmlns:winuiex="using:WinUIEx"
IsAlwaysOnTop="True"
IsMaximizable="False"
IsMinimizable="False"
@@ -15,16 +15,16 @@
IsShownInSwitchers="False"
IsTitleBarVisible="False"
mc:Ignorable="d">
<winex:WindowEx.Backdrop>
<!--<winex:AcrylicSystemBackdrop />-->
<winex:AcrylicSystemBackdrop
<winuiex:WindowEx.Backdrop>
<!--<winuiex:AcrylicSystemBackdrop />-->
<winuiex:AcrylicSystemBackdrop
DarkFallbackColor="#333"
DarkTintColor="Black"
DarkTintOpacity="0.8"
LightFallbackColor="#eee"
LightTintColor="White"
LightTintOpacity="0.6" />
</winex:WindowEx.Backdrop>
</winuiex:WindowEx.Backdrop>
<Grid>
<Grid.Resources>
<SolidColorBrush x:Key="ToggleButtonBackground" Color="Transparent" />
@@ -284,4 +284,4 @@
Click="ClosePanelTool_Click"/>
</StackPanel>
</Grid>
</winex:WindowEx>
</winuiex:WindowEx>

View File

@@ -25,7 +25,7 @@
<Button x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click"/>
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_MeasureTool" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_MSRET"
<TextBlock x:Uid="LearnMore_MEASURE_TOOL"
TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>

View File

@@ -1481,7 +1481,7 @@ From there, simply click on one of the supported files in the File Explorer and
<value>to toggle your video</value>
</data>
<data name="Oobe_MeasureTool_Activation.Text" xml:space="preserve">
<value>to bring up meaure tools panel</value>
<value>to bring up measure tools panel.</value>
</data>
<data name="Oobe_MeasureTool_HowToLaunch.Text" xml:space="preserve">
<value>Bounds tool lets you measure something by dragging mouse cursor. Measure tool allows tracing similar pixels along horizontal and vertical axes.</value>