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:
Andrey Nekrasov
2020-12-15 15:16:09 +03:00
committed by GitHub
parent cddf48547d
commit 212ea2de30
588 changed files with 3304 additions and 3328 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -4,4 +4,4 @@
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <Shlwapi.h>
#include <ProjectTelemetry.h>
#include <ProjectTelemetry.h>

View File

@@ -1,6 +1,6 @@
#include <windows.h>
#include "resource.h"
#include "../../../../common/version.h"
#include "../../../../common/version/version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////

View File

@@ -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() :

View File

@@ -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
{

View File

@@ -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>

View File

@@ -55,6 +55,7 @@
<ClInclude Include="thumbnail_provider.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="powerpreviewConstants.h" />
</ItemGroup>
<ItemGroup>
<None Include="powerpreview.def" />

View File

@@ -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),

View File

@@ -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

View File

@@ -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:

View File

@@ -1,6 +1,6 @@
#include <windows.h>
#include "resource.h"
#include "../../../common/version.h"
#include "../../../common/version/version.h"
1 VERSIONINFO
FILEVERSION FILE_VERSION

View File

@@ -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>