diff --git a/change/react-native-windows-2019-12-20-09-13-44-NoReactUWP.json b/change/react-native-windows-2019-12-20-09-13-44-NoReactUWP.json new file mode 100644 index 00000000000..0849f2d21cf --- /dev/null +++ b/change/react-native-windows-2019-12-20-09-13-44-NoReactUWP.json @@ -0,0 +1,8 @@ +{ + "type": "prerelease", + "comment": "Changed Microsoft.ReactNative to be independent from ReactUWP project", + "packageName": "react-native-windows", + "email": "vmorozov@microsoft.com", + "commit": "a2053e778b68834fb64e18382dbc5328ce66b269", + "date": "2019-12-20T17:13:44.280Z" +} \ No newline at end of file diff --git a/packages/E2ETest/windows/ReactUWPTestApp.sln b/packages/E2ETest/windows/ReactUWPTestApp.sln index 3be1239de1e..72d454c3bce 100644 --- a/packages/E2ETest/windows/ReactUWPTestApp.sln +++ b/packages/E2ETest/windows/ReactUWPTestApp.sln @@ -5,11 +5,6 @@ VisualStudioVersion = 16.0.29102.190 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Folly", "..\..\..\vnext\Folly\Folly.vcxproj", "{A990658C-CE31-4BCC-976F-0FC6B1AF693D}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactUWP", "..\..\..\vnext\ReactUWP\ReactUWP.vcxproj", "{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}" - ProjectSection(ProjectDependencies) = postProject - {A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {A990658C-CE31-4BCC-976F-0FC6B1AF693D} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactCommon", "..\..\..\vnext\ReactCommon\ReactCommon.vcxproj", "{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}" ProjectSection(ProjectDependencies) = postProject {A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {A990658C-CE31-4BCC-976F-0FC6B1AF693D} @@ -48,12 +43,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TreeDumpLibrary", "TreeDump EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution - ..\..\..\vnext\Chakra\Chakra.vcxitems*{2d5d43d9-cffc-4c40-b4cd-02efb4e2742b}*SharedItemsImports = 4 - ..\..\..\vnext\Shared\Shared.vcxitems*{2d5d43d9-cffc-4c40-b4cd-02efb4e2742b}*SharedItemsImports = 4 ..\..\..\vnext\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.projitems*{67a1076f-7790-4203-86ea-4402ccb5e782}*SharedItemsImports = 13 ..\..\..\vnext\JSI\Shared\JSI.Shared.vcxitems*{a62d504a-16b8-41d2-9f19-e2e86019e5e4}*SharedItemsImports = 4 ..\..\..\vnext\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.projitems*{abbb0407-0e82-486f-94ce-710900fcaadc}*SharedItemsImports = 4 ..\..\..\vnext\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.projitems*{c0a6bd9c-3ee5-4b12-8ce4-cee95178539c}*SharedItemsImports = 4 + ..\..\..\vnext\Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 + ..\..\..\vnext\JSI\Shared\JSI.Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 + ..\..\..\vnext\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM = Debug|ARM @@ -76,18 +72,6 @@ Global {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.Build.0 = Release|x64 {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.ActiveCfg = Release|Win32 {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.Build.0 = Release|Win32 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|ARM.ActiveCfg = Debug|ARM - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|ARM.Build.0 = Debug|ARM - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x64.ActiveCfg = Debug|x64 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x64.Build.0 = Debug|x64 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x86.ActiveCfg = Debug|Win32 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x86.Build.0 = Debug|Win32 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|ARM.ActiveCfg = Release|ARM - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|ARM.Build.0 = Release|ARM - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x64.ActiveCfg = Release|x64 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x64.Build.0 = Release|x64 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x86.ActiveCfg = Release|Win32 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x86.Build.0 = Release|Win32 {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM.ActiveCfg = Debug|ARM {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM.Build.0 = Debug|ARM {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.ActiveCfg = Debug|x64 @@ -184,7 +168,6 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3} - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B} = {AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3} {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD} = {AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3} {11C084A3-A57C-4296-A679-CAC17B603144} = {AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3} {A62D504A-16B8-41D2-9F19-E2E86019E5E4} = {AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3} diff --git a/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ControlStyleRegularBorder.txt b/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ControlStyleRegularBorder.txt index 8a4cb330eca..0a979e07969 100644 --- a/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ControlStyleRegularBorder.txt +++ b/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ControlStyleRegularBorder.txt @@ -1,4 +1,4 @@ -[react.uwp.ViewPanel] +[Microsoft.ReactNative.ViewPanel] Background=[NULL] BorderBrush=#00000000 BorderThickness=0,0,0,0 diff --git a/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ControlStyleRoundBorder.txt b/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ControlStyleRoundBorder.txt index 77fc06c2322..d498431e020 100644 --- a/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ControlStyleRoundBorder.txt +++ b/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ControlStyleRoundBorder.txt @@ -1,4 +1,4 @@ -[react.uwp.ViewPanel] +[Microsoft.ReactNative.ViewPanel] Background=[NULL] BorderBrush=#00000000 BorderThickness=0,0,0,0 diff --git a/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ImageWithBorder.txt b/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ImageWithBorder.txt index 6e29f528cdc..a9a9072b5b9 100644 --- a/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ImageWithBorder.txt +++ b/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ImageWithBorder.txt @@ -12,7 +12,7 @@ VerticalAlignment=Stretch Visibility=Visible Width=500 - [react.uwp.ViewPanel] + [Microsoft.ReactNative.ViewPanel] Background=[NULL] BorderBrush=#5500FF00 BorderThickness=10,10,10,10 diff --git a/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ImageWithoutBorder-Subsequent.txt b/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ImageWithoutBorder-Subsequent.txt index b4f487dba0a..39971f8b2c1 100644 --- a/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ImageWithoutBorder-Subsequent.txt +++ b/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ImageWithoutBorder-Subsequent.txt @@ -12,7 +12,7 @@ VerticalAlignment=Stretch Visibility=Visible Width=500 - [react.uwp.ViewPanel] + [Microsoft.ReactNative.ViewPanel] Background=[NULL] BorderBrush=#00000000 BorderThickness=0,0,0,0 diff --git a/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ImageWithoutBorder.txt b/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ImageWithoutBorder.txt index 7778ee0148f..55c2c907c00 100644 --- a/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ImageWithoutBorder.txt +++ b/packages/E2ETest/windows/ReactUWPTestApp/Assets/TreeDump/ImageWithoutBorder.txt @@ -1,4 +1,4 @@ -[react.uwp.ViewPanel] +[Microsoft.ReactNative.ViewPanel] Background=#FFFFFF00 BorderBrush=#00000000 BorderThickness=0,0,0,0 diff --git a/packages/microsoft-reactnative-sampleapps/windows/SampleAppCPP/SampleAppCpp.vcxproj b/packages/microsoft-reactnative-sampleapps/windows/SampleAppCPP/SampleAppCpp.vcxproj index d4262159b04..fc4db0b6d31 100644 --- a/packages/microsoft-reactnative-sampleapps/windows/SampleAppCPP/SampleAppCpp.vcxproj +++ b/packages/microsoft-reactnative-sampleapps/windows/SampleAppCPP/SampleAppCpp.vcxproj @@ -90,7 +90,7 @@ NOMINMAX;_HAS_AUTO_PTR_ETC;RN_EXPORT=;%(PreprocessorDefinitions) - $(ReactNativeWindowsDir)target\$(PlatformTarget)\$(Configuration)\ReactUWP\React.uwp.lib;ChakraRT.lib;%(AdditionalDependencies) + ChakraRT.lib;%(AdditionalDependencies) Windows diff --git a/packages/microsoft-reactnative-sampleapps/windows/SampleApps.sln b/packages/microsoft-reactnative-sampleapps/windows/SampleApps.sln index bf34b421fea..78323082280 100644 --- a/packages/microsoft-reactnative-sampleapps/windows/SampleApps.sln +++ b/packages/microsoft-reactnative-sampleapps/windows/SampleApps.sln @@ -11,11 +11,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleAppCpp", "SampleAppCp EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Folly", "..\..\..\vnext\Folly\Folly.vcxproj", "{A990658C-CE31-4BCC-976F-0FC6B1AF693D}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactUWP", "..\..\..\vnext\ReactUWP\ReactUWP.vcxproj", "{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}" - ProjectSection(ProjectDependencies) = postProject - {A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {A990658C-CE31-4BCC-976F-0FC6B1AF693D} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactCommon", "..\..\..\vnext\ReactCommon\ReactCommon.vcxproj", "{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}" ProjectSection(ProjectDependencies) = postProject {A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {A990658C-CE31-4BCC-976F-0FC6B1AF693D} @@ -50,12 +45,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative.Cxx.U EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.ReactNative.Managed.UnitTests", "..\..\..\vnext\Microsoft.ReactNative.Managed.UnitTests\Microsoft.ReactNative.Managed.UnitTests.csproj", "{46D76F7A-8FD9-4A7D-8102-2857E5DA6B84}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Shared", "..\..\..\vnext\Shared\Shared.vcxitems", "{2049DBE9-8D13-42C9-AE4B-413AE38FFFD0}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution ..\..\..\vnext\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.projitems*{09f4e6c1-2d12-4059-aa96-0b190861fd6a}*SharedItemsImports = 4 ..\..\..\vnext\JSI\Shared\JSI.Shared.vcxitems*{0cc28589-39e4-4288-b162-97b959f8b843}*SharedItemsImports = 9 - ..\..\..\vnext\Chakra\Chakra.vcxitems*{2d5d43d9-cffc-4c40-b4cd-02efb4e2742b}*SharedItemsImports = 4 - ..\..\..\vnext\Shared\Shared.vcxitems*{2d5d43d9-cffc-4c40-b4cd-02efb4e2742b}*SharedItemsImports = 4 + ..\..\..\vnext\Shared\Shared.vcxitems*{2049dbe9-8d13-42c9-ae4b-413ae38fffd0}*SharedItemsImports = 9 ..\..\..\vnext\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.projitems*{46d76f7a-8fd9-4a7d-8102-2857e5da6b84}*SharedItemsImports = 4 ..\..\..\vnext\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{47eec7f3-40d3-49ba-82c1-eaf103b54215}*SharedItemsImports = 4 ..\..\..\vnext\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.projitems*{67a1076f-7790-4203-86ea-4402ccb5e782}*SharedItemsImports = 13 @@ -65,6 +61,9 @@ Global ..\..\..\vnext\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.projitems*{c0a6bd9c-3ee5-4b12-8ce4-cee95178539c}*SharedItemsImports = 4 ..\..\..\vnext\Chakra\Chakra.vcxitems*{c38970c0-5fbf-4d69-90d8-cbac225ae895}*SharedItemsImports = 9 ..\..\..\vnext\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{da8b35b3-da00-4b02-bde6-6a397b3fd46b}*SharedItemsImports = 9 + ..\..\..\vnext\Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 + ..\..\..\vnext\JSI\Shared\JSI.Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 + ..\..\..\vnext\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM = Debug|ARM @@ -135,20 +134,6 @@ Global {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.Build.0 = Release|x64 {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.ActiveCfg = Release|Win32 {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.Build.0 = Release|Win32 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|ARM.ActiveCfg = Debug|ARM - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|ARM.Build.0 = Debug|ARM - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|ARM64.ActiveCfg = Debug|Win32 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x64.ActiveCfg = Debug|x64 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x64.Build.0 = Debug|x64 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x86.ActiveCfg = Debug|Win32 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x86.Build.0 = Debug|Win32 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|ARM.ActiveCfg = Release|ARM - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|ARM.Build.0 = Release|ARM - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|ARM64.ActiveCfg = Release|Win32 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x64.ActiveCfg = Release|x64 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x64.Build.0 = Release|x64 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x86.ActiveCfg = Release|Win32 - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x86.Build.0 = Release|Win32 {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM.ActiveCfg = Debug|ARM {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM.Build.0 = Debug|ARM {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.ActiveCfg = Debug|Win32 @@ -289,7 +274,6 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} {11C084A3-A57C-4296-A679-CAC17B603144} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} {C38970C0-5FBF-4D69-90D8-CBAC225AE895} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} @@ -301,6 +285,7 @@ Global {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} {6C60E295-C8CA-4DC5-B8BE-09888F58B249} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} {46D76F7A-8FD9-4A7D-8102-2857E5DA6B84} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} + {2049DBE9-8D13-42C9-AE4B-413AE38FFFD0} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {AE882847-CAE9-450F-8962-E76672DC23CE} diff --git a/vnext/JSI/Shared/JSI.Shared.vcxitems b/vnext/JSI/Shared/JSI.Shared.vcxitems index 5bb550f55c0..eff0374603c 100644 --- a/vnext/JSI/Shared/JSI.Shared.vcxitems +++ b/vnext/JSI/Shared/JSI.Shared.vcxitems @@ -14,8 +14,12 @@ - - + + NotUsing + + + NotUsing + diff --git a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj index 01fd1ea67be..e644274561e 100644 --- a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +++ b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj @@ -64,6 +64,9 @@ + + + @@ -79,17 +82,44 @@ Level4 /await %(AdditionalOptions) /bigobj - /DWINRT_NO_MAKE_DETECTION %(AdditionalOptions) - $(FollyDir);$(ReactNativeDir)\ReactCommon;$(ReactNativeWindowsDir)Common;$(ReactNativeWindowsDir)stubs;$(ReactNativeWindowsDir)include;$(ReactNativeWindowsDir)ReactWindowsCore;$(ReactNativeWindowsDir)include\ReactWindowsCore;$(ReactNativeWindowsDir)include\ReactUWP;$(YogaDir);%(AdditionalIncludeDirectories) + /DWINRT_NO_MAKE_DETECTION /wd4100 %(AdditionalOptions) + $(ReactNativeWindowsDir)ReactUWP;$(ReactNativeWindowsDir)ReactUWP\Views;$(ReactNativeWindowsDir)Microsoft.ReactNative\Views;$(FollyDir);$(ReactNativeDir)ReactCommon;$(ReactNativeDir)ReactCommon\jsi;$(ReactNativeWindowsDir);$(ReactNativeWindowsDir)Common;$(ReactNativeWindowsDir)stubs;$(ReactNativeWindowsDir)include;$(ReactNativeWindowsDir)ReactWindowsCore;$(ReactNativeWindowsDir)ReactWindowsCore\tracing;$(ReactNativeWindowsDir)include\ReactWindowsCore;$(YogaDir);%(AdditionalIncludeDirectories) FOLLY_NO_CONFIG;NOMINMAX;_HAS_AUTO_PTR_ETC;RN_EXPORT=;%(PreprocessorDefinitions) + + CHAKRACORE;CHAKRACORE_UWP;%(PreprocessorDefinitions) + USE_EDGEMODE_JSRT;%(PreprocessorDefinitions) + USE_HERMES;%(PreprocessorDefinitions) + USE_V8;%(PreprocessorDefinitions) + ENABLE_ETW_TRACING;%(PreprocessorDefinitions) + ENABLE_NATIVE_SYSTRACE_TO_ETW;WITH_FBSYSTRACE;%(PreprocessorDefinitions) + ENABLE_JS_SYSTRACE_TO_ETW;WITH_FBSYSTRACE;%(PreprocessorDefinitions) + + REACTWINDOWS_BUILD; + RN_PLATFORM=windows; + NOMINMAX; + FOLLY_NO_CONFIG; + RN_EXPORT=; + JSI_EXPORT=; + WIN32=0; + WINRT=1; + _HAS_AUTO_PTR_ETC; + PROJECT_ROOT_NAMESPACE=Microsoft::ReactNative; + %(PreprocessorDefinitions) + $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) - $(BaseOutDir)\ReactUWP\React.UWP.lib;ChakraRT.lib;%(AdditionalDependencies) + ChakraRT.lib;dxguid.lib;%(AdditionalDependencies) Console true Microsoft.ReactNative.def + + $(ReactNativeWindowsDir)ReactUWP\Views\cppwinrt;%(AdditionalIncludeDirectories) + @@ -103,7 +133,108 @@ NDEBUG;%(PreprocessorDefinitions) + + + + PROJECT_ROOT_NAMESPACE=$(RootNamespace) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -152,14 +283,110 @@ IReactPackageBuilder.idl - - ReactRootView.idl + + ReactRootView2.idl Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -208,14 +435,18 @@ IReactPackageBuilder.idl - - ReactRootView.idl + + ReactRootView2.idl Code + + + + @@ -244,7 +475,7 @@ Designer - + Designer @@ -262,22 +493,46 @@ - - {2d5d43d9-cffc-4c40-b4cd-02efb4e2742b} - false + + {fca38f3c-7c73-4c47-be4e-32f77fa8538d} + + + {a990658c-ce31-4bcc-976f-0fc6b1af693d} + + + {a62d504a-16b8-41d2-9f19-e2e86019e5e4} + + + {a9d95a91-4db7-4f72-beb6-fe8a5c89bfbd} + + + {11c084a3-a57c-4296-a679-cac17b603144} - - + + + 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}. - - - + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters new file mode 100644 index 00000000000..5c98fd0bf6d --- /dev/null +++ b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters @@ -0,0 +1,683 @@ + + + + + + + + + + + + + + + + + Base + + + Base + + + CxxReactUWP + + + Executors + + + Executors + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Polyester + + + Polyester + + + Polyester + + + Polyester + + + Polyester + + + Sandbox + + + Threading + + + Threading + + + Threading + + + Threading + + + Threading + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Views\Impl + + + Views\Impl + + + Views\Image + + + Views\Image + + + Views\Image + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + + + + + + + + + + + + + + Base + + + Executors + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Polyester + + + Polyester + + + Polyester + + + Polyester + + + Polyester + + + Threading + + + Threading + + + Threading + + + Threading + + + Threading + + + Threading + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules\Animated + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Modules + + + Views\Impl + + + Views\Impl + + + Views\Image + + + Views\Image + + + Views\Image + + + Views\Image + + + Views\Image + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + Views + + + + + + + + + + + + + + + + + + + + + + Views\cppwinrt + + + Views\cppwinrt + + + Views\cppwinrt + + + Views\cppwinrt + + + + + + + + + + + + + {72fbc00f-4a01-4363-8807-378641b7a17c} + + + {eaf2746e-5458-40cd-ae5c-38254eee1b4e} + + + {2c78db3b-c1c1-4951-870e-02e0964bcb00} + + + {1fe62423-356b-44a9-a97c-79950d299afe} + + + {6b91c1d6-19ab-4e90-b1fc-117882a865b3} + + + {b0b76275-4a16-4939-87ee-f777cb189114} + + + {6aa1c8f1-0381-4981-af8b-2053dec9c135} + + + {0bbf2d47-533d-4daf-8102-4334e786ac65} + + + {7d98959f-0655-4d14-b73a-68f001ff9d12} + + + {c7bc39da-51b4-4410-846f-ffc20dfa57cc} + + + {c3b4164c-f768-4259-9ef1-ceeaa04ce57a} + + + {a78b93f6-3e91-4fac-a33c-ba1d1a6662c6} + + + {3b861ea5-e87b-4783-a4b1-ce28548c1985} + + + \ No newline at end of file diff --git a/vnext/Microsoft.ReactNative/ReactNativeHost.cpp b/vnext/Microsoft.ReactNative/ReactNativeHost.cpp index 848b949a532..f90b4b338dd 100644 --- a/vnext/Microsoft.ReactNative/ReactNativeHost.cpp +++ b/vnext/Microsoft.ReactNative/ReactNativeHost.cpp @@ -8,7 +8,7 @@ #include "ReactInstanceManager.h" #include "ReactInstanceManagerBuilder.h" #include "ReactInstanceSettings.h" -#include "ReactRootView.h" +#include "ReactRootView2.h" #include "ReactSupport.h" #include diff --git a/vnext/Microsoft.ReactNative/ReactNativeHost.h b/vnext/Microsoft.ReactNative/ReactNativeHost.h index 473b0937ba5..dacad1ea486 100644 --- a/vnext/Microsoft.ReactNative/ReactNativeHost.h +++ b/vnext/Microsoft.ReactNative/ReactNativeHost.h @@ -6,7 +6,7 @@ #include "ReactInstanceManager.h" #include "ReactInstanceSettings.h" -#include "ReactRootView.h" +#include "ReactRootView2.h" #include #include diff --git a/vnext/Microsoft.ReactNative/ReactNativeHost.idl b/vnext/Microsoft.ReactNative/ReactNativeHost.idl index c0d9f2208cc..ef9a0029cd3 100644 --- a/vnext/Microsoft.ReactNative/ReactNativeHost.idl +++ b/vnext/Microsoft.ReactNative/ReactNativeHost.idl @@ -4,7 +4,7 @@ import "IReactPackageProvider.idl"; import "ReactInstanceManager.idl"; import "ReactInstanceSettings.idl"; -import "ReactRootView.idl"; +import "ReactRootView2.idl"; namespace Microsoft.ReactNative { diff --git a/vnext/Microsoft.ReactNative/ReactRootView.cpp b/vnext/Microsoft.ReactNative/ReactRootView2.cpp similarity index 99% rename from vnext/Microsoft.ReactNative/ReactRootView.cpp rename to vnext/Microsoft.ReactNative/ReactRootView2.cpp index 49b54d2d83f..daf36fefab3 100644 --- a/vnext/Microsoft.ReactNative/ReactRootView.cpp +++ b/vnext/Microsoft.ReactNative/ReactRootView2.cpp @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include "pch.h" -#include "ReactRootView.h" +#include "ReactRootView2.h" #include "ReactRootView.g.cpp" #include diff --git a/vnext/Microsoft.ReactNative/ReactRootView.h b/vnext/Microsoft.ReactNative/ReactRootView2.h similarity index 100% rename from vnext/Microsoft.ReactNative/ReactRootView.h rename to vnext/Microsoft.ReactNative/ReactRootView2.h diff --git a/vnext/Microsoft.ReactNative/ReactRootView.idl b/vnext/Microsoft.ReactNative/ReactRootView2.idl similarity index 100% rename from vnext/Microsoft.ReactNative/ReactRootView.idl rename to vnext/Microsoft.ReactNative/ReactRootView2.idl diff --git a/vnext/Microsoft.ReactNative/packages.config b/vnext/Microsoft.ReactNative/packages.config index bd147ef8642..d37961bee6e 100644 --- a/vnext/Microsoft.ReactNative/packages.config +++ b/vnext/Microsoft.ReactNative/packages.config @@ -1,5 +1,6 @@  + \ No newline at end of file diff --git a/vnext/Microsoft.ReactNative/pch.h b/vnext/Microsoft.ReactNative/pch.h index 1ca56659815..4b675f4ddc3 100644 --- a/vnext/Microsoft.ReactNative/pch.h +++ b/vnext/Microsoft.ReactNative/pch.h @@ -3,9 +3,40 @@ #pragma once +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#ifndef NOGDI +#define NOGDI +#endif + #include +#include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include #include "HResult.h" -#include "folly/dynamic.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include diff --git a/vnext/ReactUWP/Views/DynamicAutomationPeer.cpp b/vnext/ReactUWP/Views/DynamicAutomationPeer.cpp index a8f2b40ed38..38d0c5a0887 100644 --- a/vnext/ReactUWP/Views/DynamicAutomationPeer.cpp +++ b/vnext/ReactUWP/Views/DynamicAutomationPeer.cpp @@ -9,6 +9,11 @@ #include #include +// Needed for latest versions of C++/WinRT +#if __has_include("DynamicAutomationPeer.g.cpp") +#include "DynamicAutomationPeer.g.cpp" +#endif + namespace winrt { using namespace Windows::Foundation; using namespace Windows::UI::Xaml; @@ -20,7 +25,7 @@ using namespace Windows::UI::Xaml::Interop; using namespace Windows::UI::Xaml::Media; } // namespace winrt -namespace winrt::react::uwp::implementation { +namespace winrt::PROJECT_ROOT_NAMESPACE::implementation { DynamicAutomationPeer::DynamicAutomationPeer(winrt::FrameworkElement const &owner) : Super(owner) {} @@ -42,57 +47,57 @@ winrt::AutomationControlType DynamicAutomationPeer::GetAutomationControlTypeCore auto accessibilityRole = GetAccessibilityRole(); switch (accessibilityRole) { - case winrt::react::uwp::AccessibilityRoles::Button: - case winrt::react::uwp::AccessibilityRoles::ImageButton: - case winrt::react::uwp::AccessibilityRoles::Switch: // Both ToggleSwitch and - // ToggleButton return - // "Button" + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Button: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::ImageButton: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Switch: // Both ToggleSwitch and + // ToggleButton return + // "Button" return winrt::AutomationControlType::Button; - case winrt::react::uwp::AccessibilityRoles::Link: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Link: return winrt::AutomationControlType::Hyperlink; - case winrt::react::uwp::AccessibilityRoles::Image: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Image: return winrt::AutomationControlType::Image; - case winrt::react::uwp::AccessibilityRoles::KeyboardKey: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::KeyboardKey: return winrt::AutomationControlType::Custom; - case winrt::react::uwp::AccessibilityRoles::Text: - case winrt::react::uwp::AccessibilityRoles::Header: - case winrt::react::uwp::AccessibilityRoles::Summary: - case winrt::react::uwp::AccessibilityRoles::Alert: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Text: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Header: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Summary: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Alert: return winrt::AutomationControlType::Text; - case winrt::react::uwp::AccessibilityRoles::Adjustable: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Adjustable: return winrt::AutomationControlType::Slider; - case winrt::react::uwp::AccessibilityRoles::CheckBox: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::CheckBox: return winrt::AutomationControlType::CheckBox; - case winrt::react::uwp::AccessibilityRoles::ComboBox: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::ComboBox: return winrt::AutomationControlType::ComboBox; - case winrt::react::uwp::AccessibilityRoles::Menu: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Menu: return winrt::AutomationControlType::Menu; - case winrt::react::uwp::AccessibilityRoles::MenuBar: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::MenuBar: return winrt::AutomationControlType::MenuBar; - case winrt::react::uwp::AccessibilityRoles::MenuItem: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::MenuItem: return winrt::AutomationControlType::MenuItem; - case winrt::react::uwp::AccessibilityRoles::ProgressBar: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::ProgressBar: return winrt::AutomationControlType::ProgressBar; - case winrt::react::uwp::AccessibilityRoles::Radio: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Radio: return winrt::AutomationControlType::RadioButton; - case winrt::react::uwp::AccessibilityRoles::ScrollBar: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::ScrollBar: return winrt::AutomationControlType::ScrollBar; - case winrt::react::uwp::AccessibilityRoles::SpinButton: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::SpinButton: return winrt::AutomationControlType::Spinner; - case winrt::react::uwp::AccessibilityRoles::Tab: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Tab: return winrt::AutomationControlType::TabItem; - case winrt::react::uwp::AccessibilityRoles::TabList: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::TabList: return winrt::AutomationControlType::Tab; - case winrt::react::uwp::AccessibilityRoles::ToolBar: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::ToolBar: return winrt::AutomationControlType::ToolBar; - case winrt::react::uwp::AccessibilityRoles::List: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::List: return winrt::AutomationControlType::List; - case winrt::react::uwp::AccessibilityRoles::ListItem: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::ListItem: return winrt::AutomationControlType::ListItem; - case winrt::react::uwp::AccessibilityRoles::None: - case winrt::react::uwp::AccessibilityRoles::Search: - case winrt::react::uwp::AccessibilityRoles::RadioGroup: - case winrt::react::uwp::AccessibilityRoles::Timer: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::None: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Search: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::RadioGroup: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Timer: return winrt::AutomationControlType::Group; } @@ -103,27 +108,27 @@ winrt::IInspectable DynamicAutomationPeer::GetPatternCore(winrt::PatternInterfac auto accessibilityRole = GetAccessibilityRole(); if (patternInterface == winrt::PatternInterface::Invoke && - (accessibilityRole == winrt::react::uwp::AccessibilityRoles::Button || - accessibilityRole == winrt::react::uwp::AccessibilityRoles::ImageButton || - accessibilityRole == winrt::react::uwp::AccessibilityRoles::Radio)) { + (accessibilityRole == winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Button || + accessibilityRole == winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::ImageButton || + accessibilityRole == winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Radio)) { return *this; } else if ( (patternInterface == winrt::PatternInterface::Selection || patternInterface == winrt::PatternInterface::SelectionItem) && - HasAccessibilityState(winrt::react::uwp::AccessibilityStates::Selected)) { + HasAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Selected)) { return *this; } else if ( patternInterface == winrt::PatternInterface::Toggle && - (accessibilityRole == winrt::react::uwp::AccessibilityRoles::CheckBox || - accessibilityRole == winrt::react::uwp::AccessibilityRoles::Switch || - accessibilityRole == winrt::react::uwp::AccessibilityRoles::Radio) && - (HasAccessibilityState(winrt::react::uwp::AccessibilityStates::Checked) || - HasAccessibilityState(winrt::react::uwp::AccessibilityStates::Unchecked))) { + (accessibilityRole == winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::CheckBox || + accessibilityRole == winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Switch || + accessibilityRole == winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Radio) && + (HasAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Checked) || + HasAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Unchecked))) { return *this; } else if ( patternInterface == winrt::PatternInterface::ExpandCollapse && - (HasAccessibilityState(winrt::react::uwp::AccessibilityStates::Expanded) || - HasAccessibilityState(winrt::react::uwp::AccessibilityStates::Collapsed))) { + (HasAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Expanded) || + HasAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Collapsed))) { return *this; } @@ -131,8 +136,8 @@ winrt::IInspectable DynamicAutomationPeer::GetPatternCore(winrt::PatternInterfac } bool DynamicAutomationPeer::IsEnabledCore() const { - bool disabled = HasAccessibilityState(winrt::react::uwp::AccessibilityStates::Disabled) && - GetAccessibilityState(winrt::react::uwp::AccessibilityStates::Disabled); + bool disabled = HasAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Disabled) && + GetAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Disabled); return !disabled && Super::IsEnabledCore(); } @@ -140,8 +145,8 @@ winrt::hstring DynamicAutomationPeer::GetItemStatusCore() const { winrt::hstring itemStatus = Super::GetItemStatusCore(); if (itemStatus.empty()) { - if (HasAccessibilityState(winrt::react::uwp::AccessibilityStates::Busy) && - GetAccessibilityState(winrt::react::uwp::AccessibilityStates::Busy)) { + if (HasAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Busy) && + GetAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Busy)) { itemStatus = L"Busy"; } } @@ -172,7 +177,7 @@ winrt::com_array DynamicAutomationPeer::GetSel // ISelectionItemProvider bool DynamicAutomationPeer::IsSelected() const { - return GetAccessibilityState(winrt::react::uwp::AccessibilityStates::Selected); + return GetAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Selected); } winrt::IRawElementProviderSimple DynamicAutomationPeer::SelectionContainer() const { @@ -199,8 +204,8 @@ void DynamicAutomationPeer::Select() const { // IToggleProvider winrt::ToggleState DynamicAutomationPeer::ToggleState() const { - bool checkedState = GetAccessibilityState(winrt::react::uwp::AccessibilityStates::Checked); - bool uncheckedState = GetAccessibilityState(winrt::react::uwp::AccessibilityStates::Unchecked); + bool checkedState = GetAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Checked); + bool uncheckedState = GetAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Unchecked); if (!checkedState && uncheckedState) { return winrt::ToggleState::Off; @@ -222,8 +227,8 @@ void DynamicAutomationPeer::Toggle() const { // IExpandCollapseProvider winrt::ExpandCollapseState DynamicAutomationPeer::ExpandCollapseState() const { - bool expandedState = GetAccessibilityState(winrt::react::uwp::AccessibilityStates::Expanded); - bool collapsedState = GetAccessibilityState(winrt::react::uwp::AccessibilityStates::Collapsed); + bool expandedState = GetAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Expanded); + bool collapsedState = GetAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Collapsed); if (!expandedState && collapsedState) { return winrt::ExpandCollapseState::Collapsed; @@ -251,7 +256,7 @@ winrt::hstring DynamicAutomationPeer::GetContentName() const { try { if (auto const &owner = Owner()) { - if (auto const &viewControl = owner.try_as()) { + if (auto const &viewControl = owner.try_as()) { auto viewPanel = viewControl.GetPanel(); for (auto const &child : viewPanel.Children()) { @@ -269,7 +274,7 @@ winrt::hstring DynamicAutomationPeer::GetContentName() const { return name; } -winrt::react::uwp::AccessibilityRoles DynamicAutomationPeer::GetAccessibilityRole() const { +winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles DynamicAutomationPeer::GetAccessibilityRole() const { try { if (auto const &owner = Owner()) { return DynamicAutomationProperties::GetAccessibilityRole(owner); @@ -277,33 +282,33 @@ winrt::react::uwp::AccessibilityRoles DynamicAutomationPeer::GetAccessibilityRol } catch (...) { } - return winrt::react::uwp::AccessibilityRoles::None; + return winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::None; } -bool DynamicAutomationPeer::HasAccessibilityState(winrt::react::uwp::AccessibilityStates state) const { +bool DynamicAutomationPeer::HasAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates state) const { try { if (auto const &owner = Owner()) { winrt::IInspectable value = nullptr; switch (state) { - case winrt::react::uwp::AccessibilityStates::Selected: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Selected: value = owner.ReadLocalValue(DynamicAutomationProperties::AccessibilityStateSelectedProperty()); break; - case winrt::react::uwp::AccessibilityStates::Disabled: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Disabled: value = owner.ReadLocalValue(DynamicAutomationProperties::AccessibilityStateDisabledProperty()); break; - case winrt::react::uwp::AccessibilityStates::Checked: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Checked: value = owner.ReadLocalValue(DynamicAutomationProperties::AccessibilityStateCheckedProperty()); break; - case winrt::react::uwp::AccessibilityStates::Unchecked: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Unchecked: value = owner.ReadLocalValue(DynamicAutomationProperties::AccessibilityStateUncheckedProperty()); break; - case winrt::react::uwp::AccessibilityStates::Busy: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Busy: value = owner.ReadLocalValue(DynamicAutomationProperties::AccessibilityStateBusyProperty()); break; - case winrt::react::uwp::AccessibilityStates::Expanded: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Expanded: value = owner.ReadLocalValue(DynamicAutomationProperties::AccessibilityStateExpandedProperty()); break; - case winrt::react::uwp::AccessibilityStates::Collapsed: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Collapsed: value = owner.ReadLocalValue(DynamicAutomationProperties::AccessibilityStateCollapsedProperty()); break; } @@ -315,23 +320,23 @@ bool DynamicAutomationPeer::HasAccessibilityState(winrt::react::uwp::Accessibili return false; } -bool DynamicAutomationPeer::GetAccessibilityState(winrt::react::uwp::AccessibilityStates state) const { +bool DynamicAutomationPeer::GetAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates state) const { try { if (auto const &owner = Owner()) { switch (state) { - case winrt::react::uwp::AccessibilityStates::Selected: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Selected: return DynamicAutomationProperties::GetAccessibilityStateSelected(owner); - case winrt::react::uwp::AccessibilityStates::Disabled: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Disabled: return DynamicAutomationProperties::GetAccessibilityStateDisabled(owner); - case winrt::react::uwp::AccessibilityStates::Checked: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Checked: return DynamicAutomationProperties::GetAccessibilityStateChecked(owner); - case winrt::react::uwp::AccessibilityStates::Unchecked: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Unchecked: return DynamicAutomationProperties::GetAccessibilityStateUnchecked(owner); - case winrt::react::uwp::AccessibilityStates::Busy: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Busy: return DynamicAutomationProperties::GetAccessibilityStateBusy(owner); - case winrt::react::uwp::AccessibilityStates::Expanded: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Expanded: return DynamicAutomationProperties::GetAccessibilityStateExpanded(owner); - case winrt::react::uwp::AccessibilityStates::Collapsed: + case winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates::Collapsed: return DynamicAutomationProperties::GetAccessibilityStateCollapsed(owner); } } @@ -341,7 +346,8 @@ bool DynamicAutomationPeer::GetAccessibilityState(winrt::react::uwp::Accessibili return false; } -winrt::react::uwp::AccessibilityInvokeEventHandler DynamicAutomationPeer::GetAccessibilityInvokeEventHandler() const { +winrt::PROJECT_ROOT_NAMESPACE::AccessibilityInvokeEventHandler +DynamicAutomationPeer::GetAccessibilityInvokeEventHandler() const { try { if (auto const &owner = Owner()) { return DynamicAutomationProperties::GetAccessibilityInvokeEventHandler(owner); @@ -352,4 +358,4 @@ winrt::react::uwp::AccessibilityInvokeEventHandler DynamicAutomationPeer::GetAcc return nullptr; } -} // namespace winrt::react::uwp::implementation +} // namespace winrt::PROJECT_ROOT_NAMESPACE::implementation diff --git a/vnext/ReactUWP/Views/DynamicAutomationPeer.h b/vnext/ReactUWP/Views/DynamicAutomationPeer.h index 58724cb3fed..c3e1c88ca7d 100644 --- a/vnext/ReactUWP/Views/DynamicAutomationPeer.h +++ b/vnext/ReactUWP/Views/DynamicAutomationPeer.h @@ -13,7 +13,8 @@ #include "DynamicAutomationProperties.h" #include "DynamicAutomationPeer.g.h" -namespace winrt::react::uwp::implementation { + +namespace winrt::PROJECT_ROOT_NAMESPACE::implementation { // // DynamicAutomationPeer translates the values of the attached properties in @@ -66,16 +67,16 @@ struct DynamicAutomationPeer : DynamicAutomationPeerT { private: winrt::hstring GetContentName() const; - winrt::react::uwp::AccessibilityRoles GetAccessibilityRole() const; - bool HasAccessibilityState(winrt::react::uwp::AccessibilityStates state) const; - bool GetAccessibilityState(winrt::react::uwp::AccessibilityStates state) const; - winrt::react::uwp::AccessibilityInvokeEventHandler GetAccessibilityInvokeEventHandler() const; + winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles GetAccessibilityRole() const; + bool HasAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates state) const; + bool GetAccessibilityState(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityStates state) const; + winrt::PROJECT_ROOT_NAMESPACE::AccessibilityInvokeEventHandler GetAccessibilityInvokeEventHandler() const; static winrt::Windows::UI::Xaml::DependencyProperty AccessibilityActionsProperty(); static void SetAccessibilityActions( Windows::UI::Xaml::UIElement const &element, - Windows::Foundation::Collections::IVector const &value); - static Windows::Foundation::Collections::IVector GetAccessibilityActions( + Windows::Foundation::Collections::IVector const &value); + static Windows::Foundation::Collections::IVector GetAccessibilityActions( Windows::UI::Xaml::UIElement const &element); static void DispatchAccessibilityAction( Windows::UI::Xaml::UIElement const &element, @@ -83,12 +84,12 @@ struct DynamicAutomationPeer : DynamicAutomationPeerT { static winrt::Windows::UI::Xaml::DependencyProperty AccessibilityActionEventHandlerProperty(); static void SetAccessibilityActionEventHandler( Windows::UI::Xaml::UIElement const &element, - winrt::react::uwp::AccessibilityActionEventHandler const &value); - static winrt::react::uwp::AccessibilityActionEventHandler GetAccessibilityActionEventHandler( + winrt::PROJECT_ROOT_NAMESPACE::AccessibilityActionEventHandler const &value); + static winrt::PROJECT_ROOT_NAMESPACE::AccessibilityActionEventHandler GetAccessibilityActionEventHandler( winrt::Windows::UI::Xaml::UIElement const &element); }; -} // namespace winrt::react::uwp::implementation +} // namespace winrt::PROJECT_ROOT_NAMESPACE::implementation -namespace winrt::react::uwp::factory_implementation { +namespace winrt::PROJECT_ROOT_NAMESPACE::factory_implementation { struct DynamicAutomationPeer : DynamicAutomationPeerT {}; -} // namespace winrt::react::uwp::factory_implementation +} // namespace winrt::PROJECT_ROOT_NAMESPACE::factory_implementation diff --git a/vnext/ReactUWP/Views/DynamicAutomationProperties.cpp b/vnext/ReactUWP/Views/DynamicAutomationProperties.cpp index 45f7f11f73c..29580019967 100644 --- a/vnext/ReactUWP/Views/DynamicAutomationProperties.cpp +++ b/vnext/ReactUWP/Views/DynamicAutomationProperties.cpp @@ -8,6 +8,11 @@ #include #include +// Needed for latest versions of C++/WinRT +#if __has_include("DynamicAutomationProperties.g.cpp") +#include "DynamicAutomationProperties.g.cpp" +#endif + namespace winrt { using namespace Windows::Foundation; using namespace Windows::UI; @@ -15,7 +20,7 @@ using namespace Windows::UI::Xaml; using namespace Windows::UI::Xaml::Interop; } // namespace winrt -namespace winrt::react::uwp::implementation { +namespace winrt::PROJECT_ROOT_NAMESPACE::implementation { const winrt::TypeName dynamicAutomationTypeName{winrt::hstring{L"DynamicAutomationProperties"}, winrt::TypeKind::Metadata}; @@ -23,22 +28,23 @@ const winrt::TypeName dynamicAutomationTypeName{winrt::hstring{L"DynamicAutomati winrt::Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityRoleProperty() { static winrt::DependencyProperty s_AccessibilityRoleProperty = winrt::DependencyProperty::RegisterAttached( L"AccessibilityRole", - winrt::xaml_typename(), + winrt::xaml_typename(), dynamicAutomationTypeName, - winrt::PropertyMetadata(winrt::box_value(winrt::react::uwp::AccessibilityRoles::Unknown))); + winrt::PropertyMetadata(winrt::box_value(winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles::Unknown))); return s_AccessibilityRoleProperty; } void DynamicAutomationProperties::SetAccessibilityRole( winrt::Windows::UI::Xaml::UIElement const &element, - winrt::react::uwp::AccessibilityRoles const &value) { - element.SetValue(AccessibilityRoleProperty(), winrt::box_value(value)); + winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles const &value) { + element.SetValue(AccessibilityRoleProperty(), winrt::box_value(value)); } -winrt::react::uwp::AccessibilityRoles DynamicAutomationProperties::GetAccessibilityRole( +winrt::PROJECT_ROOT_NAMESPACE::AccessibilityRoles DynamicAutomationProperties::GetAccessibilityRole( winrt::Windows::UI::Xaml::UIElement const &element) { - return winrt::unbox_value(element.GetValue(AccessibilityRoleProperty())); + return winrt::unbox_value( + element.GetValue(AccessibilityRoleProperty())); } winrt::Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityStateSelectedProperty() { @@ -185,31 +191,32 @@ winrt::Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::Access static winrt::DependencyProperty s_AccessibilityInvokeEventHandlerProperty = winrt::DependencyProperty::RegisterAttached( L"AccessibilityInvokeEventHandler", - winrt::xaml_typename(), + winrt::xaml_typename(), dynamicAutomationTypeName, - winrt::PropertyMetadata(winrt::box_value(nullptr))); + winrt::PropertyMetadata( + winrt::box_value(nullptr))); return s_AccessibilityInvokeEventHandlerProperty; } void DynamicAutomationProperties::SetAccessibilityInvokeEventHandler( winrt::Windows::UI::Xaml::UIElement const &element, - winrt::react::uwp::AccessibilityInvokeEventHandler const &value) { + winrt::PROJECT_ROOT_NAMESPACE::AccessibilityInvokeEventHandler const &value) { element.SetValue( AccessibilityInvokeEventHandlerProperty(), - winrt::box_value(value)); + winrt::box_value(value)); } -winrt::react::uwp::AccessibilityInvokeEventHandler DynamicAutomationProperties::GetAccessibilityInvokeEventHandler( - winrt::Windows::UI::Xaml::UIElement const &element) { - return winrt::unbox_value( +winrt::PROJECT_ROOT_NAMESPACE::AccessibilityInvokeEventHandler +DynamicAutomationProperties::GetAccessibilityInvokeEventHandler(winrt::Windows::UI::Xaml::UIElement const &element) { + return winrt::unbox_value( element.GetValue(AccessibilityInvokeEventHandlerProperty())); } winrt::Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityActionsProperty() { static winrt::DependencyProperty s_AccessibilityActionsProperty = winrt::DependencyProperty::RegisterAttached( L"AccessibilityActions", - winrt::xaml_typename>(), + winrt::xaml_typename>(), dynamicAutomationTypeName, winrt::PropertyMetadata(nullptr)); @@ -218,13 +225,13 @@ winrt::Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::Access void DynamicAutomationProperties::SetAccessibilityActions( Windows::UI::Xaml::UIElement const &element, - Windows::Foundation::Collections::IVector const &value) { + Windows::Foundation::Collections::IVector const &value) { return element.SetValue(AccessibilityActionsProperty(), winrt::box_value(value)); } -Windows::Foundation::Collections::IVector +Windows::Foundation::Collections::IVector DynamicAutomationProperties::GetAccessibilityActions(Windows::UI::Xaml::UIElement const &element) { - return winrt::unbox_value>( + return winrt::unbox_value>( element.GetValue(AccessibilityActionsProperty())); } @@ -251,24 +258,25 @@ winrt::Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::Access static winrt::DependencyProperty s_AccessibilityActionEventHandlerProperty = winrt::DependencyProperty::RegisterAttached( L"AccessibilityActionEventHandler", - winrt::xaml_typename(), + winrt::xaml_typename(), dynamicAutomationTypeName, - winrt::PropertyMetadata(winrt::box_value(nullptr))); + winrt::PropertyMetadata( + winrt::box_value(nullptr))); return s_AccessibilityActionEventHandlerProperty; } void DynamicAutomationProperties::SetAccessibilityActionEventHandler( winrt::Windows::UI::Xaml::UIElement const &element, - winrt::react::uwp::AccessibilityActionEventHandler const &value) { + winrt::PROJECT_ROOT_NAMESPACE::AccessibilityActionEventHandler const &value) { element.SetValue( AccessibilityActionEventHandlerProperty(), - winrt::box_value(value)); + winrt::box_value(value)); } -winrt::react::uwp::AccessibilityActionEventHandler DynamicAutomationProperties::GetAccessibilityActionEventHandler( - winrt::Windows::UI::Xaml::UIElement const &element) { - return winrt::unbox_value( +winrt::PROJECT_ROOT_NAMESPACE::AccessibilityActionEventHandler +DynamicAutomationProperties::GetAccessibilityActionEventHandler(winrt::Windows::UI::Xaml::UIElement const &element) { + return winrt::unbox_value( element.GetValue(AccessibilityActionEventHandlerProperty())); } -} // namespace winrt::react::uwp::implementation +} // namespace winrt::PROJECT_ROOT_NAMESPACE::implementation diff --git a/vnext/ReactUWP/Views/DynamicAutomationProperties.h b/vnext/ReactUWP/Views/DynamicAutomationProperties.h index 105046bd45b..7e6fd46fa78 100644 --- a/vnext/ReactUWP/Views/DynamicAutomationProperties.h +++ b/vnext/ReactUWP/Views/DynamicAutomationProperties.h @@ -7,7 +7,16 @@ #include "DynamicAutomationProperties.g.h" -namespace winrt::react::uwp::implementation { +#ifndef PROJECT_ROOT_NAMESPACE +#define PROJECT_ROOT_NAMESPACE react::uwp +#else +namespace winrt::Microsoft::ReactNative {} +namespace winrt::react::uwp { +using namespace winrt::Microsoft::ReactNative; +} +#endif + +namespace winrt::PROJECT_ROOT_NAMESPACE::implementation { // // DynamicAutomationProperties provides attached properties for the various @@ -25,7 +34,7 @@ struct DynamicAutomationProperties : DynamicAutomationPropertiesT const &value); + Windows::Foundation::Collections::IVector const &value); - static Windows::Foundation::Collections::IVector GetAccessibilityActions( + static Windows::Foundation::Collections::IVector GetAccessibilityActions( Windows::UI::Xaml::UIElement const &element); static void DispatchAccessibilityAction( @@ -79,17 +88,17 @@ struct DynamicAutomationProperties : DynamicAutomationPropertiesT {}; -} // namespace winrt::react::uwp::factory_implementation +} // namespace winrt::PROJECT_ROOT_NAMESPACE::factory_implementation namespace react::uwp { // Issue #2172: Calling static members on @@ -99,5 +108,5 @@ namespace react::uwp { // using cppwinrt. This workaround is so that consumers in react::uwp can just // call DynamicAutomationProperties -using DynamicAutomationProperties = winrt::react::uwp::implementation::DynamicAutomationProperties; +using DynamicAutomationProperties = winrt::PROJECT_ROOT_NAMESPACE::implementation::DynamicAutomationProperties; } // namespace react::uwp diff --git a/vnext/ReactUWP/Views/ViewControl.cpp b/vnext/ReactUWP/Views/ViewControl.cpp index cb6c788a566..d35cfba2f9c 100644 --- a/vnext/ReactUWP/Views/ViewControl.cpp +++ b/vnext/ReactUWP/Views/ViewControl.cpp @@ -6,12 +6,17 @@ #include "DynamicAutomationPeer.h" #include "ViewControl.h" +// Needed for latest versions of C++/WinRT +#if __has_include("ViewControl.g.cpp") +#include "ViewControl.g.cpp" +#endif + namespace winrt { using namespace Windows::UI::Xaml::Automation::Peers; using namespace Windows::UI::Xaml; } // namespace winrt -namespace winrt::react::uwp::implementation { +namespace winrt::PROJECT_ROOT_NAMESPACE::implementation { ViewControl::ViewControl() : Super() { VerticalContentAlignment(winrt::VerticalAlignment::Stretch); @@ -19,20 +24,20 @@ ViewControl::ViewControl() : Super() { } winrt::AutomationPeer ViewControl::OnCreateAutomationPeer() { - return winrt::make(*this); + return winrt::make(*this); } -winrt::react::uwp::ViewPanel ViewControl::GetPanel() const { +winrt::PROJECT_ROOT_NAMESPACE::ViewPanel ViewControl::GetPanel() const { auto child = Content(); if (auto border = child.try_as()) { child = border.Child(); } - auto panel = child.try_as(); + auto panel = child.try_as(); assert(panel != nullptr); return panel; } -} // namespace winrt::react::uwp::implementation +} // namespace winrt::PROJECT_ROOT_NAMESPACE::implementation diff --git a/vnext/ReactUWP/Views/ViewControl.h b/vnext/ReactUWP/Views/ViewControl.h index e731cea9b98..b9ac5674789 100644 --- a/vnext/ReactUWP/Views/ViewControl.h +++ b/vnext/ReactUWP/Views/ViewControl.h @@ -9,7 +9,8 @@ #include #include "ViewControl.g.h" -namespace winrt::react::uwp::implementation { + +namespace winrt::PROJECT_ROOT_NAMESPACE::implementation { // // ViewControl is a ContentControl that ViewViewManager uses to wrap a ViewPanel @@ -24,11 +25,11 @@ struct ViewControl : ViewControlT { winrt::Windows::UI::Xaml::Automation::Peers::AutomationPeer OnCreateAutomationPeer(); - winrt::react::uwp::ViewPanel GetPanel() const; + winrt::PROJECT_ROOT_NAMESPACE::ViewPanel GetPanel() const; }; -} // namespace winrt::react::uwp::implementation +} // namespace winrt::PROJECT_ROOT_NAMESPACE::implementation -namespace winrt::react::uwp::factory_implementation { +namespace winrt::PROJECT_ROOT_NAMESPACE::factory_implementation { struct ViewControl : ViewControlT {}; -} // namespace winrt::react::uwp::factory_implementation +} // namespace winrt::PROJECT_ROOT_NAMESPACE::factory_implementation diff --git a/vnext/ReactUWP/Views/ViewPanel.cpp b/vnext/ReactUWP/Views/ViewPanel.cpp index d680cd808b9..bb303216122 100644 --- a/vnext/ReactUWP/Views/ViewPanel.cpp +++ b/vnext/ReactUWP/Views/ViewPanel.cpp @@ -9,6 +9,11 @@ #include #include +// Needed for latest versions of C++/WinRT +#if __has_include("ViewPanel.g.cpp") +#include "ViewPanel.g.cpp" +#endif + namespace winrt { using namespace Windows::UI; using namespace Windows::UI::Xaml; @@ -19,7 +24,7 @@ using namespace Windows::UI::Xaml::Media; using namespace Windows::Foundation; } // namespace winrt -namespace winrt::react::uwp::implementation { +namespace winrt::PROJECT_ROOT_NAMESPACE::implementation { const winrt::TypeName viewPanelTypeName{winrt::hstring{L"ViewPanel"}, winrt::TypeKind::Metadata}; @@ -350,4 +355,4 @@ void ViewPanel::UpdateClip(winrt::Size &finalSize) { } } -} // namespace winrt::react::uwp::implementation +} // namespace winrt::PROJECT_ROOT_NAMESPACE::implementation diff --git a/vnext/ReactUWP/Views/ViewPanel.h b/vnext/ReactUWP/Views/ViewPanel.h index a21ae77aa80..dce9f947615 100644 --- a/vnext/ReactUWP/Views/ViewPanel.h +++ b/vnext/ReactUWP/Views/ViewPanel.h @@ -10,7 +10,16 @@ #include "ViewPanel.g.h" -namespace winrt::react::uwp::implementation { +#ifndef PROJECT_ROOT_NAMESPACE +#define PROJECT_ROOT_NAMESPACE react::uwp +#else +namespace winrt::Microsoft::ReactNative {} +namespace winrt::react::uwp { +using namespace winrt::Microsoft::ReactNative; +} +#endif + +namespace winrt::PROJECT_ROOT_NAMESPACE::implementation { // // ViewPanel is our custom Panel used by ViewViewManager @@ -103,11 +112,11 @@ struct ViewPanel : ViewPanelT { winrt::Windows::UI::Xaml::DependencyPropertyChangedEventArgs e); }; -} // namespace winrt::react::uwp::implementation +} // namespace winrt::PROJECT_ROOT_NAMESPACE::implementation -namespace winrt::react::uwp::factory_implementation { +namespace winrt::PROJECT_ROOT_NAMESPACE::factory_implementation { struct ViewPanel : ViewPanelT {}; -} // namespace winrt::react::uwp::factory_implementation +} // namespace winrt::PROJECT_ROOT_NAMESPACE::factory_implementation namespace react::uwp { // Issue #2172: Calling static members on winrt::react::uwp::ViewPanel fails to @@ -116,5 +125,5 @@ namespace react::uwp { // using cppwinrt. This workaround is so that consumers in react::uwp can just // call ViewPanel -using ViewPanel = winrt::react::uwp::implementation::ViewPanel; +using ViewPanel = winrt::PROJECT_ROOT_NAMESPACE::implementation::ViewPanel; } // namespace react::uwp diff --git a/vnext/ReactUWP/Views/cppwinrt/AccessibilityAction.idl b/vnext/ReactUWP/Views/cppwinrt/AccessibilityAction.idl index 3db3f0160c5..23ed221cb04 100644 --- a/vnext/ReactUWP/Views/cppwinrt/AccessibilityAction.idl +++ b/vnext/ReactUWP/Views/cppwinrt/AccessibilityAction.idl @@ -1,10 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -namespace react.uwp +// The AccessibilityAction must be in the project namespace to be +// usable by Xaml dependency properties. +// We use a macro to be able to change it from the project file. +#ifndef PROJECT_ROOT_NAMESPACE +#define PROJECT_ROOT_NAMESPACE react.uwp +#endif + +namespace PROJECT_ROOT_NAMESPACE { [version(1)] - struct AccessibilityAction { + struct AccessibilityAction + { String Name; String Label; }; diff --git a/vnext/ReactUWP/Views/cppwinrt/DynamicAutomationPeer.idl b/vnext/ReactUWP/Views/cppwinrt/DynamicAutomationPeer.idl index 5875fd45fe1..193b397c5f5 100644 --- a/vnext/ReactUWP/Views/cppwinrt/DynamicAutomationPeer.idl +++ b/vnext/ReactUWP/Views/cppwinrt/DynamicAutomationPeer.idl @@ -9,8 +9,15 @@ #define VERSION 1.0 import "AccessibilityAction.idl"; - -namespace react.uwp + +// The DynamicAutomationProperties must be in the project namespace to be +// usable by Xaml dependency properties. +// We use a macro to be able to change it from the project file. +#ifndef PROJECT_ROOT_NAMESPACE +#define PROJECT_ROOT_NAMESPACE react.uwp +#endif + +namespace PROJECT_ROOT_NAMESPACE { enum AccessibilityRoles { @@ -60,7 +67,7 @@ namespace react.uwp }; delegate void AccessibilityInvokeEventHandler(); - delegate void AccessibilityActionEventHandler(AccessibilityAction action); + delegate void AccessibilityActionEventHandler(AccessibilityAction action); [default_interface] [webhosthidden] diff --git a/vnext/ReactUWP/Views/cppwinrt/ViewPanel.idl b/vnext/ReactUWP/Views/cppwinrt/ViewPanel.idl index b3dcacfe96a..7a809891e9e 100644 --- a/vnext/ReactUWP/Views/cppwinrt/ViewPanel.idl +++ b/vnext/ReactUWP/Views/cppwinrt/ViewPanel.idl @@ -8,7 +8,14 @@ import "DynamicAutomationPeer.idl"; -namespace react.uwp +// The ViewPanel must be in the project namespace to be +// usable by Xaml dependency properties. +// We use a macro to be able to change it from the project file. +#ifndef PROJECT_ROOT_NAMESPACE +#define PROJECT_ROOT_NAMESPACE react.uwp +#endif + +namespace PROJECT_ROOT_NAMESPACE { [default_interface] [webhosthidden] diff --git a/vnext/ReactWindows-Universal.sln b/vnext/ReactWindows-Universal.sln index c154e02a60d..69af7ca6b07 100644 --- a/vnext/ReactWindows-Universal.sln +++ b/vnext/ReactWindows-Universal.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.960 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29613.14 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Folly", "Folly\Folly.vcxproj", "{A990658C-CE31-4BCC-976F-0FC6B1AF693D}" EndProject @@ -101,6 +101,9 @@ Global JSI\Shared\JSI.Shared.vcxitems*{a62d504a-16b8-41d2-9f19-e2e86019e5e4}*SharedItemsImports = 4 Chakra\Chakra.vcxitems*{c38970c0-5fbf-4d69-90d8-cbac225ae895}*SharedItemsImports = 9 Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{da8b35b3-da00-4b02-bde6-6a397b3fd46b}*SharedItemsImports = 9 + Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 + JSI\Shared\JSI.Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 + Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM = Debug|ARM