mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
common: refactor common library pt2 (#8588)
- remove common lib - split settings, remove common-md - move ipc interop/kb_layout to interop - rename core -> settings, settings -> old_settings - os-detect header-only; interop -> PowerToysInterop - split notifications, move single-use headers where they're used - winstore lib - rename com utils - rename Updating and Telemetry projects - rename core -> settings-ui and remove examples folder - rename settings-ui folder + consisent common/version include
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\common\ManagedTelemetry\Telemetry\Telemetry.csproj" />
|
||||
<ProjectReference Include="..\..\..\common\ManagedTelemetry\Telemetry\ManagedTelemetry.csproj" />
|
||||
<ProjectReference Include="..\common\PreviewHandlerCommon.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\common\ManagedTelemetry\Telemetry\Telemetry.csproj" />
|
||||
<ProjectReference Include="..\..\..\common\ManagedTelemetry\Telemetry\ManagedTelemetry.csproj" />
|
||||
<ProjectReference Include="..\common\PreviewHandlerCommon.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<Compile Include="..\..\..\codeAnalysis\GlobalSuppressions.cs" Link="GlobalSuppressions.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\common\ManagedTelemetry\Telemetry\Telemetry.csproj" />
|
||||
<ProjectReference Include="..\..\..\common\ManagedTelemetry\Telemetry\ManagedTelemetry.csproj" />
|
||||
<ProjectReference Include="..\Common\PreviewHandlerCommon.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
#include <winrt/Windows.Foundation.h>
|
||||
#include <winrt/Windows.Foundation.Collections.h>
|
||||
#include <Shlwapi.h>
|
||||
#include <ProjectTelemetry.h>
|
||||
#include <ProjectTelemetry.h>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
#include "../../../../common/version.h"
|
||||
#include "../../../../common/version/version.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
#include "pch.h"
|
||||
#include <settings_objects.h>
|
||||
#include <common.h>
|
||||
#include <common/SettingsAPI/settings_objects.h>
|
||||
#include "powerpreview.h"
|
||||
#include "trace.h"
|
||||
#include "settings.h"
|
||||
#include "Generated Files/resource.h"
|
||||
#include <common/notifications.h>
|
||||
#include <common/os-detect.h>
|
||||
#include <common/toast_dont_show_again.h>
|
||||
#include <common/notifications/dont_show_again.h>
|
||||
#include <common/notifications/notifications.h>
|
||||
|
||||
#include <common/utils/elevation.h>
|
||||
#include <common/utils/resources.h>
|
||||
#include <common/utils/os-detect.h>
|
||||
|
||||
// Constructor
|
||||
PowerPreviewModule::PowerPreviewModule() :
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
#include "pch.h"
|
||||
#include <interface/powertoy_module_interface.h>
|
||||
#include <common.h>
|
||||
#include "trace.h"
|
||||
#include "settings.h"
|
||||
#include "thumbnail_provider.h"
|
||||
#include "preview_handler.h"
|
||||
#include "registry_wrapper.h"
|
||||
#include <powerpreview\powerpreviewConstants.h>
|
||||
#include <powerpreview/powerpreviewConstants.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
using namespace PowerPreviewSettings;
|
||||
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
|
||||
// Implement the PowerToy Module Interface and all the required methods.
|
||||
class PowerPreviewModule : public PowertoyModuleIface
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?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.200729.8\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
|
||||
<Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild">
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(SolutionDir)tools\build\convert-resx-to-rc.ps1 . resource.base.h resource.h powerpreview.base.rc powerpreview.rc" />
|
||||
</Target>
|
||||
@@ -16,7 +15,6 @@
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
@@ -32,7 +30,6 @@
|
||||
<PropertyGroup>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\modules\FileExplorerPreview\</OutDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
@@ -43,7 +40,6 @@
|
||||
<ModuleDefinitionFile>powerpreview.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CLSID.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
@@ -75,8 +71,17 @@
|
||||
<None Include="powerpreview.base.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\common\common.vcxproj">
|
||||
<Project>{74485049-c722-400f-abe5-86ac52d929b3}</Project>
|
||||
<ProjectReference Include="..\..\..\common\COMUtils\COMUtils.vcxproj">
|
||||
<Project>{7319089e-46d6-4400-bc65-e39bdf1416ee}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\common\Display\Display.vcxproj">
|
||||
<Project>{caba8dfb-823b-4bf2-93ac-3f31984150d9}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\common\notifications\notifications.vcxproj">
|
||||
<Project>{1d5be09d-78c0-4fd7-af00-ae7c1af7c525}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\common\SettingsAPI\SetttingsAPI.vcxproj">
|
||||
<Project>{6955446d-23f7-4023-9bb3-8657f904af99}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
<ClInclude Include="thumbnail_provider.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="powerpreviewConstants.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="powerpreview.def" />
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include <common.h>
|
||||
#include "settings.h"
|
||||
#include "trace.h"
|
||||
#include <iostream>
|
||||
@@ -9,8 +8,6 @@ using namespace std;
|
||||
|
||||
namespace PowerPreviewSettings
|
||||
{
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
|
||||
// Base Settings Class Implementation
|
||||
FileExplorerPreviewSettings::FileExplorerPreviewSettings(bool toggleSettingEnabled, const std::wstring& toggleSettingName, const std::wstring& toggleSettingDescription, LPCWSTR clsid, const std::wstring& registryValueData, std::unique_ptr<RegistryWrapperIface> registryWrapper) :
|
||||
m_toggleSettingEnabled(toggleSettingEnabled),
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#pragma once
|
||||
#include <pch.h>
|
||||
#include <string>
|
||||
#include "Generated Files/resource.h"
|
||||
#include <settings_objects.h>
|
||||
#include <common/SettingsAPI/settings_objects.h>
|
||||
#include "registry_wrapper_interface.h"
|
||||
|
||||
namespace PowerPreviewSettings
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "pch.h"
|
||||
#include "CppUnitTest.h"
|
||||
#include <settings_objects.h>
|
||||
#include <common/SettingsAPI/settings_objects.h>
|
||||
|
||||
#include <powerpreview/settings.cpp>
|
||||
#include <powerpreview/trace.cpp>
|
||||
#include <common.h>
|
||||
#include <powerpreview/registry_wrapper.h>
|
||||
#include <powerpreview/preview_handler.cpp>
|
||||
#include <powerpreview/thumbnail_provider.cpp>
|
||||
@@ -14,8 +14,6 @@ using namespace PowerPreviewSettings;
|
||||
|
||||
namespace FileExplorerPreviewSettingsTest
|
||||
{
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
|
||||
struct FunctionProperties
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
#include "../../../common/version.h"
|
||||
#include "../../../common/version/version.h"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION FILE_VERSION
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
@@ -35,7 +34,6 @@
|
||||
<PropertyGroup>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\modules\FileExplorerPreview\</OutDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\;..\..\..\common;..\..\..\common\telemetry;..\..\;..\..\..\;..\..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
@@ -52,7 +50,6 @@
|
||||
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ClCompile Include="FileExplorerPreviewSettingsTest.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
@@ -64,8 +61,8 @@
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\common\common.vcxproj">
|
||||
<Project>{74485049-c722-400f-abe5-86ac52d929b3}</Project>
|
||||
<ProjectReference Include="..\..\..\common\SettingsAPI\SetttingsAPI.vcxproj">
|
||||
<Project>{6955446d-23f7-4023-9bb3-8657f904af99}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user