From 97d8b690f5c78ee2fc6a3e74a9c3b50072f2e0e6 Mon Sep 17 00:00:00 2001 From: "Zihan Chen (MSFT)" Date: Wed, 6 Nov 2019 15:18:01 -0800 Subject: [PATCH 01/29] Add jscallinvoker\jsireact and turbomodule\core to ReactCommon.vcxproj --- vnext/ReactCommon/ReactCommon.vcxproj | 25 ++++++--- vnext/ReactCommon/ReactCommon.vcxproj.filters | 51 +++++++++++++++++++ 2 files changed, 70 insertions(+), 6 deletions(-) diff --git a/vnext/ReactCommon/ReactCommon.vcxproj b/vnext/ReactCommon/ReactCommon.vcxproj index 8aacde11a28..4e966397d3b 100644 --- a/vnext/ReactCommon/ReactCommon.vcxproj +++ b/vnext/ReactCommon/ReactCommon.vcxproj @@ -65,7 +65,7 @@ NotUsing false true - $(ReactNativeDir)\ReactCommon;$(JSI_Source);$(ReactNativeDir)\ReactCommon\jsiexecutor;$(FollyDir);$(ReactNativeWindowsDir)stubs;;$(ReactNativeWindowsDir)\ReactWindowsCore\tracing;%(AdditionalIncludeDirectories) + $(ReactNativeDir)\ReactCommon;$(JSI_Source);$(ReactNativeDir)\ReactCommon\jscallinvoker;$(ReactNativeDir)\ReactCommon\jsiexecutor;$(FollyDir);$(ReactNativeWindowsDir)stubs;$(ReactNativeWindowsDir)\ReactWindowsCore\tracing;%(AdditionalIncludeDirectories) ENABLE_NATIVE_SYSTRACE;WITH_FBSYSTRACE;%(PreprocessorDefinitions) ENABLE_JS_SYSTRACE;WITH_FBSYSTRACE;%(PreprocessorDefinitions) ENABLE_TRACE_POSTPROCESSING;%(PreprocessorDefinitions) @@ -92,6 +92,13 @@ + + + + + + + @@ -137,11 +144,11 @@ - - - - - + + + + + true @@ -155,6 +162,12 @@ + + + + + + diff --git a/vnext/ReactCommon/ReactCommon.vcxproj.filters b/vnext/ReactCommon/ReactCommon.vcxproj.filters index 0a0d316a02f..12fdc8e3b60 100644 --- a/vnext/ReactCommon/ReactCommon.vcxproj.filters +++ b/vnext/ReactCommon/ReactCommon.vcxproj.filters @@ -28,6 +28,18 @@ {9c8e7a7a-c77d-479d-8611-1ece3cdacad7} + + {23b0c36f-4a4b-4380-9e4c-f8cb0c2f2714} + + + {c4d010df-7391-4171-8658-9048078a5523} + + + {d52a2ed0-f060-446c-a049-1dae4aca1194} + + + {5bf47134-bd38-4ada-a2bb-9438240d70cf} + @@ -111,6 +123,24 @@ yoga + + turbomodule\core + + + turbomodule\core + + + turbomodule\core + + + turbomodule\core + + + turbomodule\core + + + jscallinvoker\jsireact + @@ -230,6 +260,27 @@ privatedata + + turbomodule\core + + + turbomodule\core + + + turbomodule\core + + + turbomodule\core + + + turbomodule\core + + + jscallinvoker\jsireact + + + jscallinvoker\jsireact + From 06fae2aad2332893be0c30dc5d9a661b047a9d4f Mon Sep 17 00:00:00 2001 From: "Zihan Chen (MSFT)" Date: Wed, 6 Nov 2019 16:09:10 -0800 Subject: [PATCH 02/29] Use $(ReactNativeDir) --- vnext/ReactCommon/ReactCommon.vcxproj | 26 ++++++++--------- vnext/ReactCommon/ReactCommon.vcxproj.filters | 28 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/vnext/ReactCommon/ReactCommon.vcxproj b/vnext/ReactCommon/ReactCommon.vcxproj index 4e966397d3b..cd8def17f6c 100644 --- a/vnext/ReactCommon/ReactCommon.vcxproj +++ b/vnext/ReactCommon/ReactCommon.vcxproj @@ -92,13 +92,13 @@ - - - - - - - + + + + + + + @@ -162,12 +162,12 @@ - - - - - - + + + + + + diff --git a/vnext/ReactCommon/ReactCommon.vcxproj.filters b/vnext/ReactCommon/ReactCommon.vcxproj.filters index 12fdc8e3b60..6538d2ea366 100644 --- a/vnext/ReactCommon/ReactCommon.vcxproj.filters +++ b/vnext/ReactCommon/ReactCommon.vcxproj.filters @@ -1,4 +1,4 @@ - + @@ -123,22 +123,22 @@ yoga - + turbomodule\core - + turbomodule\core - + turbomodule\core - + turbomodule\core - + turbomodule\core - + jscallinvoker\jsireact @@ -260,25 +260,25 @@ privatedata - + turbomodule\core - + turbomodule\core - + turbomodule\core - + turbomodule\core - + turbomodule\core - + jscallinvoker\jsireact - + jscallinvoker\jsireact From af821337124b0cceb32267aa04b56813af3bd15d Mon Sep 17 00:00:00 2001 From: "Zihan Chen (MSFT)" Date: Thu, 7 Nov 2019 15:33:07 -0800 Subject: [PATCH 03/29] Update react-native-uwp.x86.def --- vnext/ReactUWP/EndPoints/dll/react-native-uwp.x86.def | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vnext/ReactUWP/EndPoints/dll/react-native-uwp.x86.def b/vnext/ReactUWP/EndPoints/dll/react-native-uwp.x86.def index b74e3e775e3..249b4506b71 100644 --- a/vnext/ReactUWP/EndPoints/dll/react-native-uwp.x86.def +++ b/vnext/ReactUWP/EndPoints/dll/react-native-uwp.x86.def @@ -77,3 +77,9 @@ rallocxWeak sallocxWeak sdallocxWeak xallocxWeak +?set@HostObject@jsi@facebook@@UAEXAAVRuntime@23@ABVPropNameID@23@ABVValue@23@@Z +?getPropertyNames@HostObject@jsi@facebook@@UAE?AV?$vector@VPropNameID@jsi@facebook@@V?$allocator@VPropNameID@jsi@facebook@@@std@@@std@@AAVRuntime@23@@Z +??1Value@jsi@facebook@@QAE@XZ +??0TurboModule@react@facebook@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$shared_ptr@VJSCallInvoker@react@facebook@@@4@@Z +??1TurboModule@react@facebook@@UAE@XZ +?get@TurboModule@react@facebook@@UAE?AVValue@jsi@3@AAVRuntime@53@ABVPropNameID@53@@Z From e8515b05facbc7ecc3aaf540bb65214b74a5eca8 Mon Sep 17 00:00:00 2001 From: "Zihan Chen (MSFT)" Date: Mon, 11 Nov 2019 15:27:01 -0800 Subject: [PATCH 04/29] Update react-native-uwp.x64.def --- vnext/ReactUWP/EndPoints/dll/react-native-uwp.x64.def | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vnext/ReactUWP/EndPoints/dll/react-native-uwp.x64.def b/vnext/ReactUWP/EndPoints/dll/react-native-uwp.x64.def index 0f99b599d72..31fc48763f6 100644 --- a/vnext/ReactUWP/EndPoints/dll/react-native-uwp.x64.def +++ b/vnext/ReactUWP/EndPoints/dll/react-native-uwp.x64.def @@ -77,3 +77,9 @@ rallocxWeak sallocxWeak sdallocxWeak xallocxWeak +?set@HostObject@jsi@facebook@@UEAAXAEAVRuntime@23@AEBVPropNameID@23@AEBVValue@23@@Z +?getPropertyNames@HostObject@jsi@facebook@@UEAA?AV?$vector@VPropNameID@jsi@facebook@@V?$allocator@VPropNameID@jsi@facebook@@@std@@@std@@AEAVRuntime@23@@Z +??1Value@jsi@facebook@@QEAA@XZ +??0TurboModule@react@facebook@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$shared_ptr@VJSCallInvoker@react@facebook@@@4@@Z +??1TurboModule@react@facebook@@UEAA@XZ +?get@TurboModule@react@facebook@@UEAA?AVValue@jsi@3@AEAVRuntime@53@AEBVPropNameID@53@@Z From 80fb72d6932350c5377588ca754ee381747cdcd4 Mon Sep 17 00:00:00 2001 From: "Zihan Chen (MSFT)" Date: Mon, 11 Nov 2019 15:32:02 -0800 Subject: [PATCH 05/29] Update react-native-uwp.arm.def --- vnext/ReactUWP/EndPoints/dll/react-native-uwp.arm.def | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vnext/ReactUWP/EndPoints/dll/react-native-uwp.arm.def b/vnext/ReactUWP/EndPoints/dll/react-native-uwp.arm.def index 1a9c6357654..4b945fd6e90 100644 --- a/vnext/ReactUWP/EndPoints/dll/react-native-uwp.arm.def +++ b/vnext/ReactUWP/EndPoints/dll/react-native-uwp.arm.def @@ -49,3 +49,9 @@ rallocxWeak sallocxWeak sdallocxWeak xallocxWeak +?set@HostObject@jsi@facebook@@UAAXAAVRuntime@23@ABVPropNameID@23@ABVValue@23@@Z +?getPropertyNames@HostObject@jsi@facebook@@UAA?AV?$vector@VPropNameID@jsi@facebook@@V?$allocator@VPropNameID@jsi@facebook@@@std@@@std@@AAVRuntime@23@@Z +??1Value@jsi@facebook@@QAA@XZ +??0TurboModule@react@facebook@@QAA@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$shared_ptr@VJSCallInvoker@react@facebook@@@4@@Z +??1TurboModule@react@facebook@@UAA@XZ +?get@TurboModule@react@facebook@@UAA?AVValue@jsi@3@AAVRuntime@53@ABVPropNameID@53@@Z From 73ad736c47d6b5b62fdd98a77f5903dae3e925ba Mon Sep 17 00:00:00 2001 From: "Zihan Chen (MSFT)" Date: Wed, 13 Nov 2019 15:21:30 -0800 Subject: [PATCH 06/29] Update dependency to react-native --- packages/E2ETest/package.json | 4 ++-- packages/microsoft-reactnative-sampleapps/package.json | 4 ++-- packages/playground/package.json | 4 ++-- packages/react-native-windows-extended/package.json | 6 +++--- vnext/package.json | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/E2ETest/package.json b/packages/E2ETest/package.json index 5c55c5949c8..6b02be6f57f 100644 --- a/packages/E2ETest/package.json +++ b/packages/E2ETest/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "react": "16.8.6", - "react-native": "https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.16.tar.gz", + "react-native": "https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.20.tar.gz", "react-native-windows": "0.60.0-vnext.65", "react-native-windows-extended": "0.60.17", "rnpm-plugin-windows": "^0.3.8" @@ -53,4 +53,4 @@ "metro-react-native-babel-preset": "0.55.0", "react-test-renderer": "16.8.6" } -} +} \ No newline at end of file diff --git a/packages/microsoft-reactnative-sampleapps/package.json b/packages/microsoft-reactnative-sampleapps/package.json index 87c4eea3068..2d472b5be47 100644 --- a/packages/microsoft-reactnative-sampleapps/package.json +++ b/packages/microsoft-reactnative-sampleapps/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "react": "16.8.6", - "react-native": "https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.16.tar.gz", + "react-native": "https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.20.tar.gz", "react-native-windows": "0.60.0-vnext.65", "react-native-windows-extended": "0.60.17", "rnpm-plugin-windows": "^0.3.8" @@ -26,4 +26,4 @@ "metro-react-native-babel-preset": "0.55.0", "react-test-renderer": "16.8.6" } -} +} \ No newline at end of file diff --git a/packages/playground/package.json b/packages/playground/package.json index 7048f653098..ca67dfb8bc6 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "react": "16.8.6", - "react-native": "https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.16.tar.gz", + "react-native": "https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.20.tar.gz", "react-native-windows": "0.60.0-vnext.65", "react-native-windows-extended": "0.60.17", "rnpm-plugin-windows": "^0.3.8" @@ -26,4 +26,4 @@ "metro-react-native-babel-preset": "0.55.0", "react-test-renderer": "16.8.6" } -} +} \ No newline at end of file diff --git a/packages/react-native-windows-extended/package.json b/packages/react-native-windows-extended/package.json index 6ca688b991c..2589967ae61 100644 --- a/packages/react-native-windows-extended/package.json +++ b/packages/react-native-windows-extended/package.json @@ -34,12 +34,12 @@ "just-scripts": "^0.24.2", "prettier": "1.13.6", "react": "16.8.6", - "react-native": "https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.16.tar.gz", + "react-native": "https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.20.tar.gz", "typescript": "3.5.3" }, "peerDependencies": { "react": "16.8.6", - "react-native": "^0.60.0 || 0.60.0-microsoft.16 || https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.16.tar.gz" + "react-native": "^0.60.0 || 0.60.0-microsoft.20 || https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.20.tar.gz" }, "beachball": { "disallowedChangeTypes": [ @@ -47,4 +47,4 @@ "minor" ] } -} +} \ No newline at end of file diff --git a/vnext/package.json b/vnext/package.json index 97d1ea755f8..e6256d0e5a7 100644 --- a/vnext/package.json +++ b/vnext/package.json @@ -47,13 +47,13 @@ "eslint": "5.1.0", "just-scripts": "^0.24.2", "prettier": "1.17.0", - "react-native": "https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.16.tar.gz", + "react-native": "https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.20.tar.gz", "react": "16.8.6", "typescript": "3.5.3" }, "peerDependencies": { "react": "16.8.6", - "react-native": "^0.60.0 || 0.60.0-microsoft.16 || https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.16.tar.gz" + "react-native": "^0.60.0 || 0.60.0-microsoft.20 || https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.20.tar.gz" }, "beachball": { "defaultNpmTag": "vnext", @@ -63,4 +63,4 @@ "patch" ] } -} +} \ No newline at end of file From 333b206988be661cb1cdf9301760b441ba24facc Mon Sep 17 00:00:00 2001 From: Canhua Li Date: Wed, 6 Nov 2019 15:28:40 -0800 Subject: [PATCH 07/29] Use Microsoft.Windows.CppWinRT 2.0 (#3596) * use Microsoft.Windows.CppWinRT remove CreateViewManagersTests * Change files * remove unused code * fix format * pipeline run * delete folders to reduce disk usage * correct display name --- .ado/windows-vs-pr.yml | 12 + ...windows-2019-11-05-11-50-13-cppwinrt4.json | 8 + vnext/ReactUWP/ABI/ABIModuleLoader.h | 2 +- vnext/ReactUWP/ABI/Instance_rt.h | 2 +- vnext/ReactUWP/ABI/ReactControl_rt.h | 2 +- .../ReactUWP/ABI/idl/AccessibilityAction.idl | 21 - vnext/ReactUWP/ABI/idl/Instance.idl | 7 - vnext/ReactUWP/ABI/idl/Module.idl | 5 - vnext/ReactUWP/ABI/idl/ReactControl.idl | 7 - vnext/ReactUWP/ABI/idl/ReactUWPABI.idl | 16 + vnext/ReactUWP/EndPoints/dll/dllmain.cpp | 4 - vnext/ReactUWP/Pch/pch.h | 1 + vnext/ReactUWP/ReactUWP.vcxproj | 53 +- vnext/ReactUWP/ReactUWP.vcxproj.filters | 60 +- vnext/ReactUWP/Views/DynamicAutomationPeer.h | 2 +- .../Views/DynamicAutomationProperties.h | 2 +- vnext/ReactUWP/Views/Image/BorderEffect.h | 2 +- vnext/ReactUWP/Views/Image/ReactImage.h | 6 +- vnext/ReactUWP/Views/Image/ReactImageBrush.h | 4 - .../Impl/SnapPointManagingContentControl.h | 5 +- vnext/ReactUWP/Views/TouchEventHandler.cpp | 12 +- vnext/ReactUWP/Views/ViewControl.h | 2 +- vnext/ReactUWP/Views/ViewPanel.h | 2 +- .../ReactUWP/Views/cppwinrt/BorderEffect.g.h | 53 - .../Views/cppwinrt/DynamicAutomationPeer.g.h | 91 - .../cppwinrt/DynamicAutomationProperties.g.h | 244 -- vnext/ReactUWP/Views/cppwinrt/ViewControl.g.h | 86 - vnext/ReactUWP/Views/cppwinrt/ViewPanel.g.h | 141 - .../ReactUWP/Views/cppwinrt/buildcppwinrt.cmd | 83 - .../winrt/Microsoft.UI.Composition.Effects.h | 351 --- .../impl/Microsoft.UI.Composition.Effects.0.h | 58 - .../impl/Microsoft.UI.Composition.Effects.1.h | 16 - .../impl/Microsoft.UI.Composition.Effects.2.h | 24 - .../Views/cppwinrt/winrt/impl/react.uwp.0.h | 364 --- .../Views/cppwinrt/winrt/impl/react.uwp.1.h | 64 - .../Views/cppwinrt/winrt/impl/react.uwp.2.h | 138 - .../ReactUWP/Views/cppwinrt/winrt/react.uwp.h | 2651 ----------------- vnext/ReactUWP/packages.config | 3 + .../React.Windows.Universal.UnitTests.vcxproj | 3 +- ...indows.Universal.UnitTests.vcxproj.filters | 3 - 40 files changed, 100 insertions(+), 4510 deletions(-) create mode 100644 change/react-native-windows-2019-11-05-11-50-13-cppwinrt4.json delete mode 100644 vnext/ReactUWP/ABI/idl/AccessibilityAction.idl create mode 100644 vnext/ReactUWP/ABI/idl/ReactUWPABI.idl delete mode 100644 vnext/ReactUWP/Views/cppwinrt/BorderEffect.g.h delete mode 100644 vnext/ReactUWP/Views/cppwinrt/DynamicAutomationPeer.g.h delete mode 100644 vnext/ReactUWP/Views/cppwinrt/DynamicAutomationProperties.g.h delete mode 100644 vnext/ReactUWP/Views/cppwinrt/ViewControl.g.h delete mode 100644 vnext/ReactUWP/Views/cppwinrt/ViewPanel.g.h delete mode 100644 vnext/ReactUWP/Views/cppwinrt/buildcppwinrt.cmd delete mode 100644 vnext/ReactUWP/Views/cppwinrt/winrt/Microsoft.UI.Composition.Effects.h delete mode 100644 vnext/ReactUWP/Views/cppwinrt/winrt/impl/Microsoft.UI.Composition.Effects.0.h delete mode 100644 vnext/ReactUWP/Views/cppwinrt/winrt/impl/Microsoft.UI.Composition.Effects.1.h delete mode 100644 vnext/ReactUWP/Views/cppwinrt/winrt/impl/Microsoft.UI.Composition.Effects.2.h delete mode 100644 vnext/ReactUWP/Views/cppwinrt/winrt/impl/react.uwp.0.h delete mode 100644 vnext/ReactUWP/Views/cppwinrt/winrt/impl/react.uwp.1.h delete mode 100644 vnext/ReactUWP/Views/cppwinrt/winrt/impl/react.uwp.2.h delete mode 100644 vnext/ReactUWP/Views/cppwinrt/winrt/react.uwp.h diff --git a/.ado/windows-vs-pr.yml b/.ado/windows-vs-pr.yml index c742547cb1b..1d71dd246ec 100644 --- a/.ado/windows-vs-pr.yml +++ b/.ado/windows-vs-pr.yml @@ -79,6 +79,18 @@ jobs: contents: | ReactUWP\** + - task: DeleteFiles@1 + displayName: delete build + inputs: + SourceFolder: vnext/build + Contents: '**/*' + + - task: DeleteFiles@1 + displayName: target + inputs: + SourceFolder: vnext/target + Contents: '**/*' + - task: NuGetCommand@2 displayName: NuGet restore - Playground inputs: diff --git a/change/react-native-windows-2019-11-05-11-50-13-cppwinrt4.json b/change/react-native-windows-2019-11-05-11-50-13-cppwinrt4.json new file mode 100644 index 00000000000..23de98c0316 --- /dev/null +++ b/change/react-native-windows-2019-11-05-11-50-13-cppwinrt4.json @@ -0,0 +1,8 @@ +{ + "type": "none", + "comment": "use Microsoft.Windows.CppWinRT", + "packageName": "react-native-windows", + "email": "licanhua@live.com", + "commit": "1a49fbedd193735f47b6b6ad8359c901bd91a2bd", + "date": "2019-11-05T19:50:13.804Z" +} \ No newline at end of file diff --git a/vnext/ReactUWP/ABI/ABIModuleLoader.h b/vnext/ReactUWP/ABI/ABIModuleLoader.h index 669dd2b126c..9fe404372f2 100644 --- a/vnext/ReactUWP/ABI/ABIModuleLoader.h +++ b/vnext/ReactUWP/ABI/ABIModuleLoader.h @@ -3,8 +3,8 @@ #pragma once -#include #include +#include #include #include #include diff --git a/vnext/ReactUWP/ABI/Instance_rt.h b/vnext/ReactUWP/ABI/Instance_rt.h index 0e6c2cbd3f1..e1de2cb33f7 100644 --- a/vnext/ReactUWP/ABI/Instance_rt.h +++ b/vnext/ReactUWP/ABI/Instance_rt.h @@ -4,7 +4,7 @@ #pragma once #include -#include +#include #include "ABIModuleLoader.h" #include diff --git a/vnext/ReactUWP/ABI/ReactControl_rt.h b/vnext/ReactUWP/ABI/ReactControl_rt.h index aa535c60d33..e74cda76177 100644 --- a/vnext/ReactUWP/ABI/ReactControl_rt.h +++ b/vnext/ReactUWP/ABI/ReactControl_rt.h @@ -4,7 +4,7 @@ #pragma once #include -#include +#include #include #include diff --git a/vnext/ReactUWP/ABI/idl/AccessibilityAction.idl b/vnext/ReactUWP/ABI/idl/AccessibilityAction.idl deleted file mode 100644 index 85b4261016e..00000000000 --- a/vnext/ReactUWP/ABI/idl/AccessibilityAction.idl +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// Note: This is just a workaround should be removed in the future. -// Currently there are two folders which hold idl files: ABI/idl and Views/cppwinrt -// ABI/idl is compiled by MidlRT target, but Views/cppwinrt is built by buildcppwinrt. -// Views/cppwinrt is not merged into ReactUWP.Winmd, but ABI/idl is merged. -// so it hits without this file: Exception thrown at 0x7646EF12 (KernelBase.dll) in ReactUWPTestApp.exe: WinRT originate error - 0x80131522 : 'System.TypeLoadException: Could not find Windows Runtime type 'react.uwp.AccessibilityAction' -// This file has the same 'struct AccessibilityAction' in Views/cppwinrt/AccessibilityAction.idl. - -import "inspectable.idl"; - -namespace react.uwp -{ - [version(1)] - - struct AccessibilityAction { - String Name; - String Label; - }; -} diff --git a/vnext/ReactUWP/ABI/idl/Instance.idl b/vnext/ReactUWP/ABI/idl/Instance.idl index edc3240e5ca..c12146a249c 100644 --- a/vnext/ReactUWP/ABI/idl/Instance.idl +++ b/vnext/ReactUWP/ABI/idl/Instance.idl @@ -1,13 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import "inspectable.idl"; -import "Windows.UI.Xaml.idl"; - -import "Module.idl"; - -#define VERSION 1.0 - namespace react{ namespace uwp { diff --git a/vnext/ReactUWP/ABI/idl/Module.idl b/vnext/ReactUWP/ABI/idl/Module.idl index ec00119440b..3e1d73f879b 100644 --- a/vnext/ReactUWP/ABI/idl/Module.idl +++ b/vnext/ReactUWP/ABI/idl/Module.idl @@ -1,11 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import "inspectable.idl"; -import "Windows.Foundation.idl"; - -#define VERSION 1.0 - namespace react{ namespace uwp { diff --git a/vnext/ReactUWP/ABI/idl/ReactControl.idl b/vnext/ReactUWP/ABI/idl/ReactControl.idl index 08fce42ae86..29035288e7d 100644 --- a/vnext/ReactUWP/ABI/idl/ReactControl.idl +++ b/vnext/ReactUWP/ABI/idl/ReactControl.idl @@ -1,13 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import "inspectable.idl"; -import "Windows.UI.Xaml.Controls.idl"; - -import "Instance.idl"; - -#define VERSION 1.0 - namespace react{ namespace uwp { diff --git a/vnext/ReactUWP/ABI/idl/ReactUWPABI.idl b/vnext/ReactUWP/ABI/idl/ReactUWPABI.idl new file mode 100644 index 00000000000..577b6e1ec96 --- /dev/null +++ b/vnext/ReactUWP/ABI/idl/ReactUWPABI.idl @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import "inspectable.idl"; +import "Windows.Foundation.idl"; +import "Windows.UI.Xaml.Controls.idl"; + +#define VERSION 1.0 +#include "Module.idl" +#include "Instance.idl" +#include "ReactControl.idl" + +namespace react.uwp +{ + +} diff --git a/vnext/ReactUWP/EndPoints/dll/dllmain.cpp b/vnext/ReactUWP/EndPoints/dll/dllmain.cpp index 419ad63a984..060d19a9770 100644 --- a/vnext/ReactUWP/EndPoints/dll/dllmain.cpp +++ b/vnext/ReactUWP/EndPoints/dll/dllmain.cpp @@ -7,10 +7,6 @@ #include -extern int32_t WINRT_CALL WINRT_CanUnloadNow() noexcept; - -extern int32_t WINRT_CALL WINRT_GetActivationFactory(void *classId, void **factory) noexcept; - extern "C" HRESULT WINAPI DllCanUnloadNow(); #if !defined(__WRL_CLASSIC_COM__) diff --git a/vnext/ReactUWP/Pch/pch.h b/vnext/ReactUWP/Pch/pch.h index 2ec4355cccd..82f27ccd221 100644 --- a/vnext/ReactUWP/Pch/pch.h +++ b/vnext/ReactUWP/Pch/pch.h @@ -17,6 +17,7 @@ #include +#include #include #include #include diff --git a/vnext/ReactUWP/ReactUWP.vcxproj b/vnext/ReactUWP/ReactUWP.vcxproj index 80f5d788cab..f2fe54ede31 100644 --- a/vnext/ReactUWP/ReactUWP.vcxproj +++ b/vnext/ReactUWP/ReactUWP.vcxproj @@ -1,5 +1,6 @@ - + + Debug @@ -43,12 +44,12 @@ $(OutDir.TrimEnd("/\")) $(MSBuildThisFileDirectory)GeneratedWinmdHeader + false - @@ -69,7 +70,6 @@ true CHAKRACORE;CHAKRACORE_UWP;%(PreprocessorDefinitions) USE_EDGEMODE_JSRT;%(PreprocessorDefinitions) @@ -80,7 +80,6 @@ ENABLE_JS_SYSTRACE;WITH_FBSYSTRACE;%(PreprocessorDefinitions) ENABLE_TRACE_POSTPROCESSING;%(PreprocessorDefinitions) - OLD_CPPWINRT; REACTWINDOWS_BUILD; RN_PLATFORM=windows; NOMINMAX; @@ -106,7 +105,7 @@ dxguid.lib;%(AdditionalDependencies) - $(ProjectDir)ABI\idl + $(ProjectDir)ABI\idl;$(ProjectDir)Views\cppwinrt @@ -149,17 +148,6 @@ Endpoints\dll\react-native-uwp.oss.arm.def - - - "$(WindowsSdkDir)bin\$(WindowsTargetPlatformVersion)\$(PreferredToolArchitecture)\mdmerge.exe" - - - - - - - - @@ -237,15 +225,6 @@ - - - - - - - - - @@ -431,10 +410,19 @@ - - - - + + + true + $(IdlHeaderDirectory)\%(Filename).h + $(UnmergedWinmdDirectory)\%(Filename).winmd + + + + + + @@ -444,12 +432,19 @@ + + + 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}. + + + + diff --git a/vnext/ReactUWP/ReactUWP.vcxproj.filters b/vnext/ReactUWP/ReactUWP.vcxproj.filters index 7be5ca8dcef..96ae185f1dd 100644 --- a/vnext/ReactUWP/ReactUWP.vcxproj.filters +++ b/vnext/ReactUWP/ReactUWP.vcxproj.filters @@ -524,18 +524,6 @@ Utils - - Views\cppwinrt - - - Views\cppwinrt - - - Views\cppwinrt - - - Views\cppwinrt - Views @@ -560,21 +548,6 @@ Views\Image - - Views\cppwinrt\winrt - - - Views\cppwinrt\winrt\impl - - - Views\cppwinrt\winrt\impl - - - Views\cppwinrt\winrt\impl - - - Views\cppwinrt - Views\Image @@ -768,26 +741,25 @@ {6d877886-1c5c-45b8-8eae-2e1354cf673e} - - {e5234a36-e9ee-4ba3-9b11-02e7bd2ca6f0} - - - {24ea7245-f460-4176-82b1-3cac4cd54621} - - - ABI\idl - - - ABI\idl - - - ABI\idl - - + - + + ABI\idl + + + Views\cppwinrt + + + Views\cppwinrt + + + Views\cppwinrt + + + Views\cppwinrt + \ No newline at end of file diff --git a/vnext/ReactUWP/Views/DynamicAutomationPeer.h b/vnext/ReactUWP/Views/DynamicAutomationPeer.h index d743880a029..9b1fc405d6b 100644 --- a/vnext/ReactUWP/Views/DynamicAutomationPeer.h +++ b/vnext/ReactUWP/Views/DynamicAutomationPeer.h @@ -12,7 +12,7 @@ #include "DynamicAutomationProperties.h" -#include "cppwinrt/DynamicAutomationPeer.g.h" +#include "react.uwp.DynamicAutomationPeer.g.h" namespace winrt::react::uwp::implementation { // diff --git a/vnext/ReactUWP/Views/DynamicAutomationProperties.h b/vnext/ReactUWP/Views/DynamicAutomationProperties.h index f39b9c79619..3a2a2a3d427 100644 --- a/vnext/ReactUWP/Views/DynamicAutomationProperties.h +++ b/vnext/ReactUWP/Views/DynamicAutomationProperties.h @@ -5,7 +5,7 @@ #include -#include "cppwinrt/DynamicAutomationProperties.g.h" +#include "react.uwp.DynamicAutomationProperties.g.h" namespace winrt::react::uwp::implementation { diff --git a/vnext/ReactUWP/Views/Image/BorderEffect.h b/vnext/ReactUWP/Views/Image/BorderEffect.h index 07f22695f51..9a56525f07a 100644 --- a/vnext/ReactUWP/Views/Image/BorderEffect.h +++ b/vnext/ReactUWP/Views/Image/BorderEffect.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include "Microsoft.UI.Composition.Effects_Impl.h" namespace winrt::Microsoft::UI::Composition::Effects::implementation { diff --git a/vnext/ReactUWP/Views/Image/ReactImage.h b/vnext/ReactUWP/Views/Image/ReactImage.h index 42af2edceef..77563ecde16 100644 --- a/vnext/ReactUWP/Views/Image/ReactImage.h +++ b/vnext/ReactUWP/Views/Image/ReactImage.h @@ -30,17 +30,13 @@ struct ImageSource { struct ReactImage : winrt::Windows::UI::Xaml::Controls::CanvasT { using Super = winrt::Windows::UI::Xaml::Controls::CanvasT; - private: - // Constructors ReactImage(); public: static winrt::com_ptr Create(); - template - friend auto winrt::make_self(Args &&... args); // Overrides - virtual winrt::Windows::Foundation::Size ArrangeOverride(winrt::Windows::Foundation::Size finalSize); + winrt::Windows::Foundation::Size ArrangeOverride(winrt::Windows::Foundation::Size finalSize); // Events winrt::event_token OnLoadEnd(winrt::Windows::Foundation::EventHandler const &handler); diff --git a/vnext/ReactUWP/Views/Image/ReactImageBrush.h b/vnext/ReactUWP/Views/Image/ReactImageBrush.h index af4b7c01c3c..8bc3b98bc51 100644 --- a/vnext/ReactUWP/Views/Image/ReactImageBrush.h +++ b/vnext/ReactUWP/Views/Image/ReactImageBrush.h @@ -15,14 +15,10 @@ enum class ResizeMode { Cover = 0, Contain = 1, Stretch = 2, Repeat = 3, Center struct ReactImageBrush : winrt::Windows::UI::Xaml::Media::XamlCompositionBrushBaseT { using Super = winrt::Windows::UI::Xaml::Media::XamlCompositionBrushBaseT; - private: - // Constructors ReactImageBrush() = default; public: static winrt::com_ptr Create(); - template - friend auto winrt::make_self(Args &&... args); // XamlCompositionBaseBrush Overrides void OnConnected(); diff --git a/vnext/ReactUWP/Views/Impl/SnapPointManagingContentControl.h b/vnext/ReactUWP/Views/Impl/SnapPointManagingContentControl.h index caee004d090..c183120286e 100644 --- a/vnext/ReactUWP/Views/Impl/SnapPointManagingContentControl.h +++ b/vnext/ReactUWP/Views/Impl/SnapPointManagingContentControl.h @@ -15,13 +15,10 @@ namespace uwp { class SnapPointManagingContentControl : public winrt::ContentControlT { - private: + public: SnapPointManagingContentControl(); - public: static winrt::com_ptr Create(); - template - friend auto winrt::make_self(Args &&... args); // ScrollView Implementation void SnapToInterval(float interval); diff --git a/vnext/ReactUWP/Views/TouchEventHandler.cpp b/vnext/ReactUWP/Views/TouchEventHandler.cpp index 517ba0cd626..4ceafacfcc7 100644 --- a/vnext/ReactUWP/Views/TouchEventHandler.cpp +++ b/vnext/ReactUWP/Views/TouchEventHandler.cpp @@ -200,9 +200,15 @@ void TouchEventHandler::UpdateReactPointer( pointer.timestamp = point.Timestamp() / 1000; // us -> ms pointer.pressure = point.Properties().Pressure(); pointer.isBarrelButton = point.Properties().IsBarrelButtonPressed(); - pointer.shiftKey = !!static_cast(args.KeyModifiers() & winrt::Windows::System::VirtualKeyModifiers::Shift); - pointer.ctrlKey = !!static_cast(args.KeyModifiers() & winrt::Windows::System::VirtualKeyModifiers::Control); - pointer.altKey = !!static_cast(args.KeyModifiers() & winrt::Windows::System::VirtualKeyModifiers::Menu); + pointer.shiftKey = !!static_cast( + static_cast(args.KeyModifiers()) & + static_cast(winrt::Windows::System::VirtualKeyModifiers::Shift)); + pointer.ctrlKey = !!static_cast( + static_cast(args.KeyModifiers()) & + static_cast(winrt::Windows::System::VirtualKeyModifiers::Control)); + pointer.altKey = !!static_cast( + static_cast(args.KeyModifiers()) & + static_cast(winrt::Windows::System::VirtualKeyModifiers::Menu)); } std::optional TouchEventHandler::IndexOfPointerWithId(uint32_t pointerId) { diff --git a/vnext/ReactUWP/Views/ViewControl.h b/vnext/ReactUWP/Views/ViewControl.h index 71b9c964fa7..580d2f3d978 100644 --- a/vnext/ReactUWP/Views/ViewControl.h +++ b/vnext/ReactUWP/Views/ViewControl.h @@ -8,7 +8,7 @@ #include #include -#include "cppwinrt/ViewControl.g.h" +#include "react.uwp.ViewControl.g.h" namespace winrt::react::uwp::implementation { // diff --git a/vnext/ReactUWP/Views/ViewPanel.h b/vnext/ReactUWP/Views/ViewPanel.h index 3e60bdb0155..13583c97a72 100644 --- a/vnext/ReactUWP/Views/ViewPanel.h +++ b/vnext/ReactUWP/Views/ViewPanel.h @@ -8,7 +8,7 @@ #include #include -#include "cppwinrt/ViewPanel.g.h" +#include "react.uwp.ViewPanel.g.h" namespace winrt::react::uwp::implementation { diff --git a/vnext/ReactUWP/Views/cppwinrt/BorderEffect.g.h b/vnext/ReactUWP/Views/cppwinrt/BorderEffect.g.h deleted file mode 100644 index b92fa0d67fa..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/BorderEffect.g.h +++ /dev/null @@ -1,53 +0,0 @@ -// WARNING: Please don't edit this file. It was generated by C++/WinRT v1.0.190111.3 - -#pragma once - -#include "winrt/Windows.Graphics.Effects.h" -#include "winrt/Microsoft.UI.Composition.Effects.h" - -namespace winrt::Microsoft::UI::Composition::Effects::implementation { - -template -struct WINRT_EBO BorderEffect_base : implements -{ - using base_type = BorderEffect_base; - using class_type = Microsoft::UI::Composition::Effects::BorderEffect; - using implements_type = typename BorderEffect_base::implements_type; - using implements_type::implements_type; - -#if _MSC_VER < 1914 - operator class_type() const noexcept - { - static_assert(std::is_same_v::type, default_interface>); - class_type result{ nullptr }; - attach_abi(result, detach_abi(static_cast>(*this))); - return result; - } -#else - operator impl::producer_ref const() const noexcept - { - return { to_abi>(this) }; - } -#endif - - hstring GetRuntimeClassName() const - { - return L"Microsoft.UI.Composition.Effects.BorderEffect"; - } -}; - -} - -#if defined(WINRT_FORCE_INCLUDE_BORDEREFFECT_XAML_G_H) || __has_include("BorderEffect.xaml.g.h") - -#include "BorderEffect.xaml.g.h" - -#else - -namespace winrt::Microsoft::UI::Composition::Effects::implementation -{ - template - using BorderEffectT = BorderEffect_base; -} - -#endif diff --git a/vnext/ReactUWP/Views/cppwinrt/DynamicAutomationPeer.g.h b/vnext/ReactUWP/Views/cppwinrt/DynamicAutomationPeer.g.h deleted file mode 100644 index f8b57678360..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/DynamicAutomationPeer.g.h +++ /dev/null @@ -1,91 +0,0 @@ -// WARNING: Please don't edit this file. It was generated by C++/WinRT v1.0.190111.3 - -#pragma once - -#include "winrt/Windows.UI.Xaml.h" -#include "winrt/Windows.UI.Xaml.Automation.h" -#include "winrt/Windows.UI.Xaml.Automation.Provider.h" -#include "winrt/Windows.UI.Xaml.Controls.h" -#include "winrt/Windows.UI.Xaml.Media.h" -#include "winrt/Windows.UI.Composition.h" -#include "winrt/Windows.UI.Xaml.Automation.Peers.h" -#include "winrt/react.uwp.h" - -namespace winrt::react::uwp::implementation { - -template -struct WINRT_EBO DynamicAutomationPeer_base : implements, - impl::require, - impl::base, - Windows::UI::Xaml::Automation::Peers::IAutomationPeerOverridesT, Windows::UI::Xaml::Automation::Peers::IAutomationPeerOverrides2T, Windows::UI::Xaml::Automation::Peers::IAutomationPeerOverrides3T, Windows::UI::Xaml::Automation::Peers::IAutomationPeerOverrides4T, Windows::UI::Xaml::Automation::Peers::IAutomationPeerOverrides5T, Windows::UI::Xaml::Automation::Peers::IAutomationPeerOverrides6T, Windows::UI::Xaml::Automation::Peers::IAutomationPeerOverrides8T, Windows::UI::Xaml::Automation::Peers::IAutomationPeerOverrides9T -{ - using base_type = DynamicAutomationPeer_base; - using class_type = react::uwp::DynamicAutomationPeer; - using implements_type = typename DynamicAutomationPeer_base::implements_type; - using implements_type::implements_type; - using composable_base = Windows::UI::Xaml::Automation::Peers::FrameworkElementAutomationPeer; -#if _MSC_VER < 1914 - operator class_type() const noexcept - { - static_assert(std::is_same_v::type, default_interface>); - class_type result{ nullptr }; - attach_abi(result, detach_abi(static_cast>(*this))); - return result; - } -#else - operator impl::producer_ref const() const noexcept - { - return { to_abi>(this) }; - } -#endif - - hstring GetRuntimeClassName() const - { - return L"react.uwp.DynamicAutomationPeer"; - } - DynamicAutomationPeer_base(Windows::UI::Xaml::FrameworkElement const& owner) - { - impl::call_factory([&](auto&& f) { f.CreateInstanceWithOwner(owner, *this, this->m_inner); }); - } -}; - -} - -namespace winrt::react::uwp::factory_implementation { - -template -struct WINRT_EBO DynamicAutomationPeerT : implements -{ - using instance_type = react::uwp::DynamicAutomationPeer; - - hstring GetRuntimeClassName() const - { - return L"react.uwp.DynamicAutomationPeer"; - } - - Windows::Foundation::IInspectable ActivateInstance() const - { - throw hresult_not_implemented(); - } - - react::uwp::DynamicAutomationPeer CreateInstance(Windows::UI::Xaml::FrameworkElement const& owner) - { - return make(owner); - } -}; - -} - -#if defined(WINRT_FORCE_INCLUDE_DYNAMICAUTOMATIONPEER_XAML_G_H) || __has_include("DynamicAutomationPeer.xaml.g.h") - -#include "DynamicAutomationPeer.xaml.g.h" - -#else - -namespace winrt::react::uwp::implementation -{ - template - using DynamicAutomationPeerT = DynamicAutomationPeer_base; -} - -#endif diff --git a/vnext/ReactUWP/Views/cppwinrt/DynamicAutomationProperties.g.h b/vnext/ReactUWP/Views/cppwinrt/DynamicAutomationProperties.g.h deleted file mode 100644 index b696aabdad3..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/DynamicAutomationProperties.g.h +++ /dev/null @@ -1,244 +0,0 @@ -// WARNING: Please don't edit this file. It was generated by C++/WinRT v1.0.190111.3 - -#pragma once - -#include "winrt/Windows.UI.Xaml.h" -#include "winrt/Windows.UI.Xaml.Automation.h" -#include "winrt/Windows.UI.Xaml.Automation.Provider.h" -#include "winrt/Windows.UI.Xaml.Controls.h" -#include "winrt/Windows.UI.Xaml.Media.h" -#include "winrt/Windows.UI.Composition.h" -#include "winrt/Windows.UI.Xaml.Automation.Peers.h" -#include "winrt/react.uwp.h" - -namespace winrt::react::uwp::implementation { - -template -struct WINRT_EBO DynamicAutomationProperties_base : implements -{ - using base_type = DynamicAutomationProperties_base; - using class_type = react::uwp::DynamicAutomationProperties; - using implements_type = typename DynamicAutomationProperties_base::implements_type; - using implements_type::implements_type; - -#if _MSC_VER < 1914 - operator class_type() const noexcept - { - static_assert(std::is_same_v::type, default_interface>); - class_type result{ nullptr }; - attach_abi(result, detach_abi(static_cast>(*this))); - return result; - } -#else - operator impl::producer_ref const() const noexcept - { - return { to_abi>(this) }; - } -#endif - - hstring GetRuntimeClassName() const - { - return L"react.uwp.DynamicAutomationProperties"; - } -}; - -} - -namespace winrt::react::uwp::factory_implementation { - -template -struct WINRT_EBO DynamicAutomationPropertiesT : implements -{ - using instance_type = react::uwp::DynamicAutomationProperties; - - hstring GetRuntimeClassName() const - { - return L"react.uwp.DynamicAutomationProperties"; - } - - Windows::Foundation::IInspectable ActivateInstance() const - { - throw hresult_not_implemented(); - } - - Windows::UI::Xaml::DependencyProperty AccessibilityRoleProperty() - { - return T::AccessibilityRoleProperty(); - } - - void SetAccessibilityRole(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityRoles const& value) - { - T::SetAccessibilityRole(element, value); - } - - react::uwp::AccessibilityRoles GetAccessibilityRole(Windows::UI::Xaml::UIElement const& element) - { - return T::GetAccessibilityRole(element); - } - - Windows::UI::Xaml::DependencyProperty AccessibilityStateSelectedProperty() - { - return T::AccessibilityStateSelectedProperty(); - } - - void SetAccessibilityStateSelected(Windows::UI::Xaml::UIElement const& element, bool value) - { - T::SetAccessibilityStateSelected(element, value); - } - - bool GetAccessibilityStateSelected(Windows::UI::Xaml::UIElement const& element) - { - return T::GetAccessibilityStateSelected(element); - } - - Windows::UI::Xaml::DependencyProperty AccessibilityStateDisabledProperty() - { - return T::AccessibilityStateDisabledProperty(); - } - - void SetAccessibilityStateDisabled(Windows::UI::Xaml::UIElement const& element, bool value) - { - T::SetAccessibilityStateDisabled(element, value); - } - - bool GetAccessibilityStateDisabled(Windows::UI::Xaml::UIElement const& element) - { - return T::GetAccessibilityStateDisabled(element); - } - - Windows::UI::Xaml::DependencyProperty AccessibilityStateCheckedProperty() - { - return T::AccessibilityStateCheckedProperty(); - } - - void SetAccessibilityStateChecked(Windows::UI::Xaml::UIElement const& element, bool value) - { - T::SetAccessibilityStateChecked(element, value); - } - - bool GetAccessibilityStateChecked(Windows::UI::Xaml::UIElement const& element) - { - return T::GetAccessibilityStateChecked(element); - } - - Windows::UI::Xaml::DependencyProperty AccessibilityStateUncheckedProperty() - { - return T::AccessibilityStateUncheckedProperty(); - } - - void SetAccessibilityStateUnchecked(Windows::UI::Xaml::UIElement const& element, bool value) - { - T::SetAccessibilityStateUnchecked(element, value); - } - - bool GetAccessibilityStateUnchecked(Windows::UI::Xaml::UIElement const& element) - { - return T::GetAccessibilityStateUnchecked(element); - } - - Windows::UI::Xaml::DependencyProperty AccessibilityStateBusyProperty() - { - return T::AccessibilityStateBusyProperty(); - } - - void SetAccessibilityStateBusy(Windows::UI::Xaml::UIElement const& element, bool value) - { - T::SetAccessibilityStateBusy(element, value); - } - - bool GetAccessibilityStateBusy(Windows::UI::Xaml::UIElement const& element) - { - return T::GetAccessibilityStateBusy(element); - } - - Windows::UI::Xaml::DependencyProperty AccessibilityStateExpandedProperty() - { - return T::AccessibilityStateExpandedProperty(); - } - - void SetAccessibilityStateExpanded(Windows::UI::Xaml::UIElement const& element, bool value) - { - T::SetAccessibilityStateExpanded(element, value); - } - - bool GetAccessibilityStateExpanded(Windows::UI::Xaml::UIElement const& element) - { - return T::GetAccessibilityStateExpanded(element); - } - - Windows::UI::Xaml::DependencyProperty AccessibilityStateCollapsedProperty() - { - return T::AccessibilityStateCollapsedProperty(); - } - - void SetAccessibilityStateCollapsed(Windows::UI::Xaml::UIElement const& element, bool value) - { - T::SetAccessibilityStateCollapsed(element, value); - } - - bool GetAccessibilityStateCollapsed(Windows::UI::Xaml::UIElement const& element) - { - return T::GetAccessibilityStateCollapsed(element); - } - - Windows::UI::Xaml::DependencyProperty AccessibilityInvokeEventHandlerProperty() - { - return T::AccessibilityInvokeEventHandlerProperty(); - } - - void SetAccessibilityInvokeEventHandler(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityInvokeEventHandler const& value) - { - T::SetAccessibilityInvokeEventHandler(element, value); - } - - react::uwp::AccessibilityInvokeEventHandler GetAccessibilityInvokeEventHandler(Windows::UI::Xaml::UIElement const& element) - { - return T::GetAccessibilityInvokeEventHandler(element); - } - - Windows::UI::Xaml::DependencyProperty AccessibilityActionsProperty() - { - return T::AccessibilityActionsProperty(); - } - - void SetAccessibilityActions(Windows::UI::Xaml::UIElement const& element, Windows::Foundation::Collections::IVector const& value) - { - T::SetAccessibilityActions(element, value); - } - - Windows::Foundation::Collections::IVector GetAccessibilityActions(Windows::UI::Xaml::UIElement const& element) - { - return T::GetAccessibilityActions(element); - } - - Windows::UI::Xaml::DependencyProperty AccessibilityActionEventHandlerProperty() - { - return T::AccessibilityActionEventHandlerProperty(); - } - - void SetAccessibilityActionEventHandler(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityActionEventHandler const& value) - { - T::SetAccessibilityActionEventHandler(element, value); - } - - react::uwp::AccessibilityActionEventHandler GetAccessibilityActionEventHandler(Windows::UI::Xaml::UIElement const& element) - { - return T::GetAccessibilityActionEventHandler(element); - } -}; - -} - -#if defined(WINRT_FORCE_INCLUDE_DYNAMICAUTOMATIONPROPERTIES_XAML_G_H) || __has_include("DynamicAutomationProperties.xaml.g.h") - -#include "DynamicAutomationProperties.xaml.g.h" - -#else - -namespace winrt::react::uwp::implementation -{ - template - using DynamicAutomationPropertiesT = DynamicAutomationProperties_base; -} - -#endif diff --git a/vnext/ReactUWP/Views/cppwinrt/ViewControl.g.h b/vnext/ReactUWP/Views/cppwinrt/ViewControl.g.h deleted file mode 100644 index a5d6f9e9760..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/ViewControl.g.h +++ /dev/null @@ -1,86 +0,0 @@ -// WARNING: Please don't edit this file. It was generated by C++/WinRT v1.0.190111.3 - -#pragma once - -#include "winrt/Windows.UI.Xaml.h" -#include "winrt/Windows.UI.Xaml.Automation.h" -#include "winrt/Windows.UI.Xaml.Automation.Provider.h" -#include "winrt/Windows.UI.Xaml.Controls.h" -#include "winrt/Windows.UI.Xaml.Media.h" -#include "winrt/Windows.UI.Composition.h" -#include "winrt/Windows.UI.Xaml.Automation.Peers.h" -#include "winrt/react.uwp.h" - -namespace winrt::react::uwp::implementation { - -template -struct WINRT_EBO ViewControl_base : implements, - impl::require, - impl::base, - Windows::UI::Xaml::Controls::IContentControlOverridesT, Windows::UI::Xaml::Controls::IControlOverridesT, Windows::UI::Xaml::Controls::IControlOverrides6T, Windows::UI::Xaml::IFrameworkElementOverridesT, Windows::UI::Xaml::IFrameworkElementOverrides2T, Windows::UI::Xaml::IUIElementOverridesT, Windows::UI::Xaml::IUIElementOverrides7T, Windows::UI::Xaml::IUIElementOverrides8T, Windows::UI::Xaml::IUIElementOverrides9T -{ - using base_type = ViewControl_base; - using class_type = react::uwp::ViewControl; - using implements_type = typename ViewControl_base::implements_type; - using implements_type::implements_type; - using composable_base = Windows::UI::Xaml::Controls::ContentControl; -#if _MSC_VER < 1914 - operator class_type() const noexcept - { - static_assert(std::is_same_v::type, default_interface>); - class_type result{ nullptr }; - attach_abi(result, detach_abi(static_cast>(*this))); - return result; - } -#else - operator impl::producer_ref const() const noexcept - { - return { to_abi>(this) }; - } -#endif - - hstring GetRuntimeClassName() const - { - return L"react.uwp.ViewControl"; - } - ViewControl_base() - { - impl::call_factory([&](auto&& f) { f.CreateInstance(*this, this->m_inner); }); - } -}; - -} - -namespace winrt::react::uwp::factory_implementation { - -template -struct WINRT_EBO ViewControlT : implements -{ - using instance_type = react::uwp::ViewControl; - - hstring GetRuntimeClassName() const - { - return L"react.uwp.ViewControl"; - } - - Windows::Foundation::IInspectable ActivateInstance() const - { - return make(); - } -}; - -} - -#if defined(WINRT_FORCE_INCLUDE_VIEWCONTROL_XAML_G_H) || __has_include("ViewControl.xaml.g.h") - -#include "ViewControl.xaml.g.h" - -#else - -namespace winrt::react::uwp::implementation -{ - template - using ViewControlT = ViewControl_base; -} - -#endif diff --git a/vnext/ReactUWP/Views/cppwinrt/ViewPanel.g.h b/vnext/ReactUWP/Views/cppwinrt/ViewPanel.g.h deleted file mode 100644 index 0c1cbf1ecea..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/ViewPanel.g.h +++ /dev/null @@ -1,141 +0,0 @@ -// WARNING: Please don't edit this file. It was generated by C++/WinRT v1.0.190111.3 - -#pragma once - -#include "winrt/Windows.UI.Xaml.h" -#include "winrt/Windows.UI.Xaml.Automation.h" -#include "winrt/Windows.UI.Xaml.Automation.Provider.h" -#include "winrt/Windows.UI.Xaml.Controls.h" -#include "winrt/Windows.UI.Xaml.Media.h" -#include "winrt/Windows.UI.Composition.h" -#include "winrt/Windows.UI.Xaml.Automation.Peers.h" -#include "winrt/react.uwp.h" - -namespace winrt::react::uwp::implementation { - -template -struct WINRT_EBO ViewPanel_base : implements, - impl::require, - impl::base, - Windows::UI::Xaml::IFrameworkElementOverridesT, Windows::UI::Xaml::IFrameworkElementOverrides2T, Windows::UI::Xaml::IUIElementOverridesT, Windows::UI::Xaml::IUIElementOverrides7T, Windows::UI::Xaml::IUIElementOverrides8T, Windows::UI::Xaml::IUIElementOverrides9T -{ - using base_type = ViewPanel_base; - using class_type = react::uwp::ViewPanel; - using implements_type = typename ViewPanel_base::implements_type; - using implements_type::implements_type; - using composable_base = Windows::UI::Xaml::Controls::Panel; -#if _MSC_VER < 1914 - operator class_type() const noexcept - { - static_assert(std::is_same_v::type, default_interface>); - class_type result{ nullptr }; - attach_abi(result, detach_abi(static_cast>(*this))); - return result; - } -#else - operator impl::producer_ref const() const noexcept - { - return { to_abi>(this) }; - } -#endif - - hstring GetRuntimeClassName() const - { - return L"react.uwp.ViewPanel"; - } - ViewPanel_base() - { - impl::call_factory([&](auto&& f) { f.CreateInstance(*this, this->m_inner); }); - } -}; - -} - -namespace winrt::react::uwp::factory_implementation { - -template -struct WINRT_EBO ViewPanelT : implements -{ - using instance_type = react::uwp::ViewPanel; - - hstring GetRuntimeClassName() const - { - return L"react.uwp.ViewPanel"; - } - - Windows::Foundation::IInspectable ActivateInstance() const - { - return make(); - } - - Windows::UI::Xaml::DependencyProperty ViewBackgroundProperty() - { - return T::ViewBackgroundProperty(); - } - - Windows::UI::Xaml::DependencyProperty BorderThicknessProperty() - { - return T::BorderThicknessProperty(); - } - - Windows::UI::Xaml::DependencyProperty BorderBrushProperty() - { - return T::BorderBrushProperty(); - } - - Windows::UI::Xaml::DependencyProperty CornerRadiusProperty() - { - return T::CornerRadiusProperty(); - } - - Windows::UI::Xaml::DependencyProperty ClipChildrenProperty() - { - return T::ClipChildrenProperty(); - } - - Windows::UI::Xaml::DependencyProperty TopProperty() - { - return T::TopProperty(); - } - - void SetTop(Windows::UI::Xaml::UIElement const& element, double value) - { - T::SetTop(element, value); - } - - double GetTop(Windows::UI::Xaml::UIElement const& element) - { - return T::GetTop(element); - } - - Windows::UI::Xaml::DependencyProperty LeftProperty() - { - return T::LeftProperty(); - } - - void SetLeft(Windows::UI::Xaml::UIElement const& element, double value) - { - T::SetLeft(element, value); - } - - double GetLeft(Windows::UI::Xaml::UIElement const& element) - { - return T::GetLeft(element); - } -}; - -} - -#if defined(WINRT_FORCE_INCLUDE_VIEWPANEL_XAML_G_H) || __has_include("ViewPanel.xaml.g.h") - -#include "ViewPanel.xaml.g.h" - -#else - -namespace winrt::react::uwp::implementation -{ - template - using ViewPanelT = ViewPanel_base; -} - -#endif diff --git a/vnext/ReactUWP/Views/cppwinrt/buildcppwinrt.cmd b/vnext/ReactUWP/Views/cppwinrt/buildcppwinrt.cmd deleted file mode 100644 index c75f24d3426..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/buildcppwinrt.cmd +++ /dev/null @@ -1,83 +0,0 @@ -:: Copyright (c) Microsoft Corporation. All rights reserved. -:: Licensed under the MIT License. - -:: Until we get cppwinrt support properly included in ReactUWP, this script -:: will manually build the headers we need from each idl in this directory. - -@echo off -setlocal enabledelayedexpansion - -set TargetSDK=10.0.18362.0 - -set FoundationDir=%WindowsSdkDir%References\%TargetSDK%\Windows.Foundation.FoundationContract\3.0.0.0 -set FoundationRef=%FoundationDir%\Windows.Foundation.FoundationContract.winmd - -set UniversalApiDir=%WindowsSdkDir%References\%TargetSDK%\Windows.Foundation.UniversalApiContract\8.0.0.0 -set UniversalApiRef=%UniversalApiDir%\Windows.Foundation.UniversalApiContract.winmd - -pushd %~dp0 - -call :GetAbsolute "..\..\..\target\cppwinrt" -set TargetDir=%absolute% - -echo. -echo ### Initializing target dir ### -echo. -if not exist "%TargetDir%" call mkdir "%TargetDir%" -if exist "%TargetDir%" call del /s /q "%TargetDir%\*" - -echo. -echo ### Building winmds from idls ### -echo. - -for %%f in (*.idl) do ( - call :BuildWinmd %%f -) - -echo. -echo ### Merge winmds ### -echo. -if not exist "%TargetDir%\merged" call mkdir "%TargetDir%\merged" -call mdmerge -metadata_dir "%FoundationDir%\." -metadata_dir "%UniversalApiDir%\." -o "%TargetDir%\merged" -i "%TargetDir%" -partial - -echo. -echo ### Building headers from winmds ### - -for %%w in ("%TargetDir%\merged\*.winmd") do ( - call :BuildHeaders %%w -) - -echo. -echo ### Copy generated files into ReactUWP ### -echo. -call xcopy /Y "%TargetDir%\*.h" .\ -call xcopy /Y "%TargetDir%\winrt\*.h" .\winrt\ -call xcopy /Y "%TargetDir%\winrt\impl\*.h" .\winrt\impl\ -call xcopy /Y "%TargetDir%\module.g.cpp" ..\ - -echo. -echo ### Stubbed out implmentations (*.h and *. cpp) are in "%TargetDir%\sources" ### -echo. - -popd -goto :end - -:BuildWinmd -echo. -echo Building winmd for "%~1" -call midlrt /metadata_dir "%FoundationDir%" /winrt /W1 /nologo /char signed /env win32 /nomidl /ns_prefix /enum_class /h "NUL" /dlldata "NUL" /iid "NUL" /proxy "NUL" /notlb /client none /server none /target "NT60" /reference "%FoundationRef%" /reference "%UniversalApiRef%" /winmd "%TargetDir%\%~n1.winmd" %~1 -exit /b - -:BuildHeaders -echo. -echo Building headers for "%~1" -call cppwinrt -overwrite -prefix -comp "%TargetDir%\sources" -in "%~1" -ref %TargetSDK% -out %TargetDir% -exit /b - -:GetAbsolute -set absolute=%~f1 -exit /b - -:end -endlocal -exit /b \ No newline at end of file diff --git a/vnext/ReactUWP/Views/cppwinrt/winrt/Microsoft.UI.Composition.Effects.h b/vnext/ReactUWP/Views/cppwinrt/winrt/Microsoft.UI.Composition.Effects.h deleted file mode 100644 index 8e23dd1d685..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/winrt/Microsoft.UI.Composition.Effects.h +++ /dev/null @@ -1,351 +0,0 @@ -// WARNING: Please don't edit this file. It was generated by C++/WinRT v1.0.190111.3 - -#pragma once - -#include "winrt/base.h" - - -static_assert(winrt::check_version(CPPWINRT_VERSION, "1.0.190111.3"), "Mismatched component and base headers."); -#include "winrt/Windows.Foundation.h" -#include "winrt/Windows.Foundation.Collections.h" -#include "winrt/impl/Windows.Graphics.Effects.2.h" -#include "winrt/impl/Microsoft.UI.Composition.Effects.2.h" - -namespace winrt::impl { - -template Microsoft::UI::Composition::Effects::CanvasEdgeBehavior consume_Microsoft_UI_Composition_Effects_IBorderEffect::ExtendX() const -{ - Microsoft::UI::Composition::Effects::CanvasEdgeBehavior value{}; - check_hresult(WINRT_SHIM(Microsoft::UI::Composition::Effects::IBorderEffect)->get_ExtendX(put_abi(value))); - return value; -} - -template void consume_Microsoft_UI_Composition_Effects_IBorderEffect::ExtendX(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior const& value) const -{ - check_hresult(WINRT_SHIM(Microsoft::UI::Composition::Effects::IBorderEffect)->put_ExtendX(get_abi(value))); -} - -template Microsoft::UI::Composition::Effects::CanvasEdgeBehavior consume_Microsoft_UI_Composition_Effects_IBorderEffect::ExtendY() const -{ - Microsoft::UI::Composition::Effects::CanvasEdgeBehavior value{}; - check_hresult(WINRT_SHIM(Microsoft::UI::Composition::Effects::IBorderEffect)->get_ExtendY(put_abi(value))); - return value; -} - -template void consume_Microsoft_UI_Composition_Effects_IBorderEffect::ExtendY(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior const& value) const -{ - check_hresult(WINRT_SHIM(Microsoft::UI::Composition::Effects::IBorderEffect)->put_ExtendY(get_abi(value))); -} - -template Windows::Graphics::Effects::IGraphicsEffectSource consume_Microsoft_UI_Composition_Effects_IBorderEffect::Source() const -{ - Windows::Graphics::Effects::IGraphicsEffectSource source{ nullptr }; - check_hresult(WINRT_SHIM(Microsoft::UI::Composition::Effects::IBorderEffect)->get_Source(put_abi(source))); - return source; -} - -template void consume_Microsoft_UI_Composition_Effects_IBorderEffect::Source(Windows::Graphics::Effects::IGraphicsEffectSource const& source) const -{ - check_hresult(WINRT_SHIM(Microsoft::UI::Composition::Effects::IBorderEffect)->put_Source(get_abi(source))); -} - -template -struct produce : produce_base -{ - int32_t WINRT_CALL get_ExtendX(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior* value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(ExtendX, WINRT_WRAP(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior)); - *value = detach_from(this->shim().ExtendX()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL put_ExtendX(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(ExtendX, WINRT_WRAP(void), Microsoft::UI::Composition::Effects::CanvasEdgeBehavior const&); - this->shim().ExtendX(*reinterpret_cast(&value)); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_ExtendY(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior* value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(ExtendY, WINRT_WRAP(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior)); - *value = detach_from(this->shim().ExtendY()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL put_ExtendY(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(ExtendY, WINRT_WRAP(void), Microsoft::UI::Composition::Effects::CanvasEdgeBehavior const&); - this->shim().ExtendY(*reinterpret_cast(&value)); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_Source(void** source) noexcept final - { - try - { - *source = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(Source, WINRT_WRAP(Windows::Graphics::Effects::IGraphicsEffectSource)); - *source = detach_from(this->shim().Source()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL put_Source(void* source) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(Source, WINRT_WRAP(void), Windows::Graphics::Effects::IGraphicsEffectSource const&); - this->shim().Source(*reinterpret_cast(&source)); - return 0; - } - catch (...) { return to_hresult(); } - } -}; - -} - -WINRT_EXPORT namespace winrt::Microsoft::UI::Composition::Effects { - -} - -namespace winrt::impl { - -struct property_Microsoft_UI_Composition_Effects_IBorderEffect -{ struct named { - struct ExtendX - { - struct name { static constexpr std::wstring_view value{ L"ExtendX"sv }; }; - using property_type = winrt::Microsoft::UI::Composition::Effects::CanvasEdgeBehavior; - using target_type = winrt::Microsoft::UI::Composition::Effects::IBorderEffect; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.ExtendX(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.ExtendX(std::forward(value)); - } - }; - }; - struct ExtendY - { - struct name { static constexpr std::wstring_view value{ L"ExtendY"sv }; }; - using property_type = winrt::Microsoft::UI::Composition::Effects::CanvasEdgeBehavior; - using target_type = winrt::Microsoft::UI::Composition::Effects::IBorderEffect; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.ExtendY(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.ExtendY(std::forward(value)); - } - }; - }; - struct Source - { - struct name { static constexpr std::wstring_view value{ L"Source"sv }; }; - using property_type = winrt::Windows::Graphics::Effects::IGraphicsEffectSource; - using target_type = winrt::Microsoft::UI::Composition::Effects::IBorderEffect; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.Source(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.Source(std::forward(value)); - } - }; - };}; - struct list { using type = impl::typelist; }; -}; - -struct property_Microsoft_UI_Composition_Effects_BorderEffect -{ struct named { - struct Source - { - struct name { static constexpr std::wstring_view value{ L"Source"sv }; }; - using property_type = winrt::Windows::Graphics::Effects::IGraphicsEffectSource; - using target_type = winrt::Microsoft::UI::Composition::Effects::BorderEffect; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.Source(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.Source(std::forward(value)); - } - }; - }; - struct ExtendY - { - struct name { static constexpr std::wstring_view value{ L"ExtendY"sv }; }; - using property_type = winrt::Microsoft::UI::Composition::Effects::CanvasEdgeBehavior; - using target_type = winrt::Microsoft::UI::Composition::Effects::BorderEffect; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.ExtendY(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.ExtendY(std::forward(value)); - } - }; - }; - struct ExtendX - { - struct name { static constexpr std::wstring_view value{ L"ExtendX"sv }; }; - using property_type = winrt::Microsoft::UI::Composition::Effects::CanvasEdgeBehavior; - using target_type = winrt::Microsoft::UI::Composition::Effects::BorderEffect; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.ExtendX(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.ExtendX(std::forward(value)); - } - }; - }; - struct Name - { - struct name { static constexpr std::wstring_view value{ L"Name"sv }; }; - using property_type = winrt::hstring; - using target_type = winrt::Microsoft::UI::Composition::Effects::BorderEffect; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.Name(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.Name(std::forward(value)); - } - }; - };}; - struct list { using type = impl::typelist; }; -}; - -} - -WINRT_EXPORT namespace winrt::experimental::reflect { -template <> struct named_property : impl::property_Microsoft_UI_Composition_Effects_IBorderEffect::named {}; -template <> struct properties : impl::property_Microsoft_UI_Composition_Effects_IBorderEffect::list {}; -template <> struct named_property : impl::property_Microsoft_UI_Composition_Effects_BorderEffect::named {}; -template <> struct properties : impl::property_Microsoft_UI_Composition_Effects_BorderEffect::list {}; -template <> struct get_enumerator_names -{ - static constexpr std::array value{{ - {L"Clamp", 5}, - {L"Wrap", 4}, - {L"Mirror", 6}, }}; -}; -template <> struct get_enumerator_values -{ - static constexpr std::array value{{ - Microsoft::UI::Composition::Effects::CanvasEdgeBehavior::Clamp, - Microsoft::UI::Composition::Effects::CanvasEdgeBehavior::Wrap, - Microsoft::UI::Composition::Effects::CanvasEdgeBehavior::Mirror, }}; -}; - -} - -WINRT_EXPORT namespace std { - -template<> struct hash : winrt::impl::hash_base {}; -template<> struct hash : winrt::impl::hash_base {}; - -} diff --git a/vnext/ReactUWP/Views/cppwinrt/winrt/impl/Microsoft.UI.Composition.Effects.0.h b/vnext/ReactUWP/Views/cppwinrt/winrt/impl/Microsoft.UI.Composition.Effects.0.h deleted file mode 100644 index 1758fc5efa0..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/winrt/impl/Microsoft.UI.Composition.Effects.0.h +++ /dev/null @@ -1,58 +0,0 @@ -// WARNING: Please don't edit this file. It was generated by C++/WinRT v1.0.190111.3 - -#pragma once - -WINRT_EXPORT namespace winrt::Windows::Graphics::Effects { - -struct IGraphicsEffectSource; - -} - -WINRT_EXPORT namespace winrt::Microsoft::UI::Composition::Effects { - -enum class CanvasEdgeBehavior : int32_t -{ - Clamp = 0, - Wrap = 1, - Mirror = 2, -}; - -struct IBorderEffect; -struct BorderEffect; - -} - -namespace winrt::impl { - -template <> struct category{ using type = interface_category; }; -template <> struct category{ using type = class_category; }; -template <> struct category{ using type = enum_category; }; -template <> struct name{ static constexpr auto & value{ L"Microsoft.UI.Composition.Effects.IBorderEffect" }; }; -template <> struct name{ static constexpr auto & value{ L"Microsoft.UI.Composition.Effects.BorderEffect" }; }; -template <> struct name{ static constexpr auto & value{ L"Microsoft.UI.Composition.Effects.CanvasEdgeBehavior" }; }; -template <> struct guid_storage{ static constexpr guid value{ 0x31602441,0x15DB,0x5B4A,{ 0x98,0xDD,0xBA,0x42,0x47,0x54,0x8B,0x40 } }; }; -template <> struct default_interface{ using type = Microsoft::UI::Composition::Effects::IBorderEffect; }; - -template <> struct abi{ struct type : IInspectable -{ - virtual int32_t WINRT_CALL get_ExtendX(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior* value) noexcept = 0; - virtual int32_t WINRT_CALL put_ExtendX(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior value) noexcept = 0; - virtual int32_t WINRT_CALL get_ExtendY(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior* value) noexcept = 0; - virtual int32_t WINRT_CALL put_ExtendY(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior value) noexcept = 0; - virtual int32_t WINRT_CALL get_Source(void** source) noexcept = 0; - virtual int32_t WINRT_CALL put_Source(void* source) noexcept = 0; -};}; - -template -struct consume_Microsoft_UI_Composition_Effects_IBorderEffect -{ - Microsoft::UI::Composition::Effects::CanvasEdgeBehavior ExtendX() const; - void ExtendX(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior const& value) const; - Microsoft::UI::Composition::Effects::CanvasEdgeBehavior ExtendY() const; - void ExtendY(Microsoft::UI::Composition::Effects::CanvasEdgeBehavior const& value) const; - Windows::Graphics::Effects::IGraphicsEffectSource Source() const; - void Source(Windows::Graphics::Effects::IGraphicsEffectSource const& source) const; -}; -template <> struct consume { template using type = consume_Microsoft_UI_Composition_Effects_IBorderEffect; }; - -} diff --git a/vnext/ReactUWP/Views/cppwinrt/winrt/impl/Microsoft.UI.Composition.Effects.1.h b/vnext/ReactUWP/Views/cppwinrt/winrt/impl/Microsoft.UI.Composition.Effects.1.h deleted file mode 100644 index fb82e5ceed4..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/winrt/impl/Microsoft.UI.Composition.Effects.1.h +++ /dev/null @@ -1,16 +0,0 @@ -// WARNING: Please don't edit this file. It was generated by C++/WinRT v1.0.190111.3 - -#pragma once -#include "winrt/impl/Windows.Graphics.Effects.0.h" -#include "winrt/impl/Microsoft.UI.Composition.Effects.0.h" - -WINRT_EXPORT namespace winrt::Microsoft::UI::Composition::Effects { - -struct WINRT_EBO IBorderEffect : - Windows::Foundation::IInspectable, - impl::consume_t -{ - IBorderEffect(std::nullptr_t = nullptr) noexcept {} -}; - -} diff --git a/vnext/ReactUWP/Views/cppwinrt/winrt/impl/Microsoft.UI.Composition.Effects.2.h b/vnext/ReactUWP/Views/cppwinrt/winrt/impl/Microsoft.UI.Composition.Effects.2.h deleted file mode 100644 index e427ddc1baf..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/winrt/impl/Microsoft.UI.Composition.Effects.2.h +++ /dev/null @@ -1,24 +0,0 @@ -// WARNING: Please don't edit this file. It was generated by C++/WinRT v1.0.190111.3 - -#pragma once -#include "winrt/impl/Windows.Graphics.Effects.1.h" -#include "winrt/impl/Microsoft.UI.Composition.Effects.1.h" - -WINRT_EXPORT namespace winrt::Microsoft::UI::Composition::Effects { - -} - -namespace winrt::impl { - -} - -WINRT_EXPORT namespace winrt::Microsoft::UI::Composition::Effects { - -struct WINRT_EBO BorderEffect : - Microsoft::UI::Composition::Effects::IBorderEffect, - impl::require -{ - BorderEffect(std::nullptr_t) noexcept {} -}; - -} diff --git a/vnext/ReactUWP/Views/cppwinrt/winrt/impl/react.uwp.0.h b/vnext/ReactUWP/Views/cppwinrt/winrt/impl/react.uwp.0.h deleted file mode 100644 index 863b8ba15a6..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/winrt/impl/react.uwp.0.h +++ /dev/null @@ -1,364 +0,0 @@ -// WARNING: Please don't edit this file. It was generated by C++/WinRT v1.0.190111.3 - -#pragma once - -WINRT_EXPORT namespace winrt::Windows::UI::Xaml { - -struct CornerRadius; -struct DependencyProperty; -struct FrameworkElement; -struct Thickness; -struct UIElement; - -} - -WINRT_EXPORT namespace winrt::Windows::UI::Xaml::Automation { - -enum class ExpandCollapseState; -enum class ToggleState; - -} - -WINRT_EXPORT namespace winrt::Windows::UI::Xaml::Automation::Provider { - -struct IRawElementProviderSimple; - -} - -WINRT_EXPORT namespace winrt::Windows::UI::Xaml::Controls { - -struct Border; - -} - -WINRT_EXPORT namespace winrt::Windows::UI::Xaml::Media { - -struct Brush; - -} - -WINRT_EXPORT namespace winrt::react::uwp { - -enum class AccessibilityRoles : int32_t -{ - None = 0, - Button = 1, - Link = 2, - Search = 3, - Image = 4, - KeyboardKey = 5, - Text = 6, - Adjustable = 7, - ImageButton = 8, - Header = 9, - Summary = 10, - Alert = 11, - CheckBox = 12, - ComboBox = 13, - Menu = 14, - MenuBar = 15, - MenuItem = 16, - ProgressBar = 17, - Radio = 18, - RadioGroup = 19, - ScrollBar = 20, - SpinButton = 21, - Switch = 22, - Tab = 23, - TabList = 24, - Timer = 25, - ToolBar = 26, - List = 27, - ListItem = 28, - Unknown = 29, - CountRoles = 30, -}; - -enum class AccessibilityStates : int32_t -{ - Selected = 0, - Disabled = 1, - Checked = 2, - Unchecked = 3, - Busy = 4, - Expanded = 5, - Collapsed = 6, - CountStates = 7, -}; - -struct IDynamicAutomationPeer; -struct IDynamicAutomationPeerFactory; -struct IDynamicAutomationProperties; -struct IDynamicAutomationPropertiesStatics; -struct IViewControl; -struct IViewPanel; -struct IViewPanelStatics; -struct DynamicAutomationPeer; -struct DynamicAutomationProperties; -struct ViewControl; -struct ViewPanel; -struct AccessibilityAction; -struct AccessibilityActionEventHandler; -struct AccessibilityInvokeEventHandler; - -} - -namespace winrt::impl { - -template <> struct category{ using type = interface_category; }; -template <> struct category{ using type = interface_category; }; -template <> struct category{ using type = interface_category; }; -template <> struct category{ using type = interface_category; }; -template <> struct category{ using type = interface_category; }; -template <> struct category{ using type = interface_category; }; -template <> struct category{ using type = interface_category; }; -template <> struct category{ using type = class_category; }; -template <> struct category{ using type = class_category; }; -template <> struct category{ using type = class_category; }; -template <> struct category{ using type = class_category; }; -template <> struct category{ using type = enum_category; }; -template <> struct category{ using type = enum_category; }; -template <> struct category{ using type = struct_category; }; -template <> struct category{ using type = delegate_category; }; -template <> struct category{ using type = delegate_category; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.IDynamicAutomationPeer" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.IDynamicAutomationPeerFactory" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.IDynamicAutomationProperties" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.IDynamicAutomationPropertiesStatics" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.IViewControl" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.IViewPanel" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.IViewPanelStatics" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.DynamicAutomationPeer" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.DynamicAutomationProperties" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.ViewControl" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.ViewPanel" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.AccessibilityRoles" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.AccessibilityStates" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.AccessibilityAction" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.AccessibilityActionEventHandler" }; }; -template <> struct name{ static constexpr auto & value{ L"react.uwp.AccessibilityInvokeEventHandler" }; }; -template <> struct guid_storage{ static constexpr guid value{ 0x96D2FA46,0xD93B,0x5EB4,{ 0x9E,0xD8,0xFC,0x60,0x2C,0xB5,0xB7,0x8F } }; }; -template <> struct guid_storage{ static constexpr guid value{ 0x0F0A64B1,0xCCEF,0x54F1,{ 0xB9,0x05,0x0C,0x58,0x26,0xCB,0x6C,0xC4 } }; }; -template <> struct guid_storage{ static constexpr guid value{ 0xB70AAC96,0x549C,0x52C1,{ 0xA1,0x24,0xAE,0x0C,0xA4,0x96,0xC8,0x05 } }; }; -template <> struct guid_storage{ static constexpr guid value{ 0x8BECBDA4,0xC633,0x55B5,{ 0xA8,0x1F,0x4D,0x4B,0x03,0xFA,0x89,0xF8 } }; }; -template <> struct guid_storage{ static constexpr guid value{ 0xDD899021,0xA952,0x5F5A,{ 0xA5,0xC1,0xAC,0x9E,0x85,0x08,0x09,0xBD } }; }; -template <> struct guid_storage{ static constexpr guid value{ 0x46487875,0x5C11,0x5EBE,{ 0xAA,0x1A,0xC7,0xC9,0x70,0xCF,0x46,0x02 } }; }; -template <> struct guid_storage{ static constexpr guid value{ 0xF820A53A,0x6DFD,0x53F9,{ 0xA1,0x96,0x40,0xA4,0xED,0x81,0x8B,0x80 } }; }; -template <> struct guid_storage{ static constexpr guid value{ 0x0989B119,0x9348,0x5B3A,{ 0xA7,0x29,0x8C,0xF2,0xE5,0x01,0x6F,0x19 } }; }; -template <> struct guid_storage{ static constexpr guid value{ 0xCF396F1D,0x7B41,0x5E44,{ 0xB2,0xD5,0xBA,0xB5,0x86,0xC7,0xEE,0x33 } }; }; -template <> struct default_interface{ using type = react::uwp::IDynamicAutomationPeer; }; -template <> struct default_interface{ using type = react::uwp::IDynamicAutomationProperties; }; -template <> struct default_interface{ using type = react::uwp::IViewControl; }; -template <> struct default_interface{ using type = react::uwp::IViewPanel; }; - -template <> struct abi{ struct type : IInspectable -{ -};}; - -template <> struct abi{ struct type : IInspectable -{ - virtual int32_t WINRT_CALL CreateInstance(void* owner, void** value) noexcept = 0; -};}; - -template <> struct abi{ struct type : IInspectable -{ -};}; - -template <> struct abi{ struct type : IInspectable -{ - virtual int32_t WINRT_CALL get_AccessibilityRoleProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL SetAccessibilityRole(void* element, react::uwp::AccessibilityRoles value) noexcept = 0; - virtual int32_t WINRT_CALL GetAccessibilityRole(void* element, react::uwp::AccessibilityRoles* result) noexcept = 0; - virtual int32_t WINRT_CALL get_AccessibilityStateSelectedProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL SetAccessibilityStateSelected(void* element, bool value) noexcept = 0; - virtual int32_t WINRT_CALL GetAccessibilityStateSelected(void* element, bool* result) noexcept = 0; - virtual int32_t WINRT_CALL get_AccessibilityStateDisabledProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL SetAccessibilityStateDisabled(void* element, bool value) noexcept = 0; - virtual int32_t WINRT_CALL GetAccessibilityStateDisabled(void* element, bool* result) noexcept = 0; - virtual int32_t WINRT_CALL get_AccessibilityStateCheckedProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL SetAccessibilityStateChecked(void* element, bool value) noexcept = 0; - virtual int32_t WINRT_CALL GetAccessibilityStateChecked(void* element, bool* result) noexcept = 0; - virtual int32_t WINRT_CALL get_AccessibilityStateUncheckedProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL SetAccessibilityStateUnchecked(void* element, bool value) noexcept = 0; - virtual int32_t WINRT_CALL GetAccessibilityStateUnchecked(void* element, bool* result) noexcept = 0; - virtual int32_t WINRT_CALL get_AccessibilityStateBusyProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL SetAccessibilityStateBusy(void* element, bool value) noexcept = 0; - virtual int32_t WINRT_CALL GetAccessibilityStateBusy(void* element, bool* result) noexcept = 0; - virtual int32_t WINRT_CALL get_AccessibilityStateExpandedProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL SetAccessibilityStateExpanded(void* element, bool value) noexcept = 0; - virtual int32_t WINRT_CALL GetAccessibilityStateExpanded(void* element, bool* result) noexcept = 0; - virtual int32_t WINRT_CALL get_AccessibilityStateCollapsedProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL SetAccessibilityStateCollapsed(void* element, bool value) noexcept = 0; - virtual int32_t WINRT_CALL GetAccessibilityStateCollapsed(void* element, bool* result) noexcept = 0; - virtual int32_t WINRT_CALL get_AccessibilityInvokeEventHandlerProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL SetAccessibilityInvokeEventHandler(void* element, void* value) noexcept = 0; - virtual int32_t WINRT_CALL GetAccessibilityInvokeEventHandler(void* element, void** result) noexcept = 0; - virtual int32_t WINRT_CALL get_AccessibilityActionsProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL SetAccessibilityActions(void* element, void* value) noexcept = 0; - virtual int32_t WINRT_CALL GetAccessibilityActions(void* element, void** result) noexcept = 0; - virtual int32_t WINRT_CALL get_AccessibilityActionEventHandlerProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL SetAccessibilityActionEventHandler(void* element, void* value) noexcept = 0; - virtual int32_t WINRT_CALL GetAccessibilityActionEventHandler(void* element, void** result) noexcept = 0; -};}; - -template <> struct abi{ struct type : IInspectable -{ - virtual int32_t WINRT_CALL GetPanel(void** result) noexcept = 0; -};}; - -template <> struct abi{ struct type : IInspectable -{ - virtual int32_t WINRT_CALL InsertAt(uint32_t index, void* value) noexcept = 0; - virtual int32_t WINRT_CALL RemoveAt(uint32_t index) noexcept = 0; - virtual int32_t WINRT_CALL Clear() noexcept = 0; - virtual int32_t WINRT_CALL FinalizeProperties() noexcept = 0; - virtual int32_t WINRT_CALL GetOuterBorder(void** result) noexcept = 0; - virtual int32_t WINRT_CALL get_ViewBackground(void** value) noexcept = 0; - virtual int32_t WINRT_CALL put_ViewBackground(void* value) noexcept = 0; - virtual int32_t WINRT_CALL get_BorderThickness(struct struct_Windows_UI_Xaml_Thickness* value) noexcept = 0; - virtual int32_t WINRT_CALL put_BorderThickness(struct struct_Windows_UI_Xaml_Thickness value) noexcept = 0; - virtual int32_t WINRT_CALL get_BorderBrush(void** value) noexcept = 0; - virtual int32_t WINRT_CALL put_BorderBrush(void* value) noexcept = 0; - virtual int32_t WINRT_CALL get_CornerRadius(struct struct_Windows_UI_Xaml_CornerRadius* value) noexcept = 0; - virtual int32_t WINRT_CALL put_CornerRadius(struct struct_Windows_UI_Xaml_CornerRadius value) noexcept = 0; - virtual int32_t WINRT_CALL get_ClipChildren(bool* value) noexcept = 0; - virtual int32_t WINRT_CALL put_ClipChildren(bool value) noexcept = 0; -};}; - -template <> struct abi{ struct type : IInspectable -{ - virtual int32_t WINRT_CALL get_ViewBackgroundProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL get_BorderThicknessProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL get_BorderBrushProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL get_CornerRadiusProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL get_ClipChildrenProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL get_TopProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL SetTop(void* element, double value) noexcept = 0; - virtual int32_t WINRT_CALL GetTop(void* element, double* result) noexcept = 0; - virtual int32_t WINRT_CALL get_LeftProperty(void** value) noexcept = 0; - virtual int32_t WINRT_CALL SetLeft(void* element, double value) noexcept = 0; - virtual int32_t WINRT_CALL GetLeft(void* element, double* result) noexcept = 0; -};}; - -template <> struct abi{ struct type : IUnknown -{ - virtual int32_t WINRT_CALL Invoke(struct struct_react_uwp_AccessibilityAction action) noexcept = 0; -};}; - -template <> struct abi{ struct type : IUnknown -{ - virtual int32_t WINRT_CALL Invoke() noexcept = 0; -};}; - -template -struct consume_react_uwp_IDynamicAutomationPeer -{ -}; -template <> struct consume { template using type = consume_react_uwp_IDynamicAutomationPeer; }; - -template -struct consume_react_uwp_IDynamicAutomationPeerFactory -{ - react::uwp::DynamicAutomationPeer CreateInstance(Windows::UI::Xaml::FrameworkElement const& owner) const; -}; -template <> struct consume { template using type = consume_react_uwp_IDynamicAutomationPeerFactory; }; - -template -struct consume_react_uwp_IDynamicAutomationProperties -{ -}; -template <> struct consume { template using type = consume_react_uwp_IDynamicAutomationProperties; }; - -template -struct consume_react_uwp_IDynamicAutomationPropertiesStatics -{ - Windows::UI::Xaml::DependencyProperty AccessibilityRoleProperty() const; - void SetAccessibilityRole(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityRoles const& value) const; - react::uwp::AccessibilityRoles GetAccessibilityRole(Windows::UI::Xaml::UIElement const& element) const; - Windows::UI::Xaml::DependencyProperty AccessibilityStateSelectedProperty() const; - void SetAccessibilityStateSelected(Windows::UI::Xaml::UIElement const& element, bool value) const; - bool GetAccessibilityStateSelected(Windows::UI::Xaml::UIElement const& element) const; - Windows::UI::Xaml::DependencyProperty AccessibilityStateDisabledProperty() const; - void SetAccessibilityStateDisabled(Windows::UI::Xaml::UIElement const& element, bool value) const; - bool GetAccessibilityStateDisabled(Windows::UI::Xaml::UIElement const& element) const; - Windows::UI::Xaml::DependencyProperty AccessibilityStateCheckedProperty() const; - void SetAccessibilityStateChecked(Windows::UI::Xaml::UIElement const& element, bool value) const; - bool GetAccessibilityStateChecked(Windows::UI::Xaml::UIElement const& element) const; - Windows::UI::Xaml::DependencyProperty AccessibilityStateUncheckedProperty() const; - void SetAccessibilityStateUnchecked(Windows::UI::Xaml::UIElement const& element, bool value) const; - bool GetAccessibilityStateUnchecked(Windows::UI::Xaml::UIElement const& element) const; - Windows::UI::Xaml::DependencyProperty AccessibilityStateBusyProperty() const; - void SetAccessibilityStateBusy(Windows::UI::Xaml::UIElement const& element, bool value) const; - bool GetAccessibilityStateBusy(Windows::UI::Xaml::UIElement const& element) const; - Windows::UI::Xaml::DependencyProperty AccessibilityStateExpandedProperty() const; - void SetAccessibilityStateExpanded(Windows::UI::Xaml::UIElement const& element, bool value) const; - bool GetAccessibilityStateExpanded(Windows::UI::Xaml::UIElement const& element) const; - Windows::UI::Xaml::DependencyProperty AccessibilityStateCollapsedProperty() const; - void SetAccessibilityStateCollapsed(Windows::UI::Xaml::UIElement const& element, bool value) const; - bool GetAccessibilityStateCollapsed(Windows::UI::Xaml::UIElement const& element) const; - Windows::UI::Xaml::DependencyProperty AccessibilityInvokeEventHandlerProperty() const; - void SetAccessibilityInvokeEventHandler(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityInvokeEventHandler const& value) const; - react::uwp::AccessibilityInvokeEventHandler GetAccessibilityInvokeEventHandler(Windows::UI::Xaml::UIElement const& element) const; - Windows::UI::Xaml::DependencyProperty AccessibilityActionsProperty() const; - void SetAccessibilityActions(Windows::UI::Xaml::UIElement const& element, param::vector const& value) const; - Windows::Foundation::Collections::IVector GetAccessibilityActions(Windows::UI::Xaml::UIElement const& element) const; - Windows::UI::Xaml::DependencyProperty AccessibilityActionEventHandlerProperty() const; - void SetAccessibilityActionEventHandler(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityActionEventHandler const& value) const; - react::uwp::AccessibilityActionEventHandler GetAccessibilityActionEventHandler(Windows::UI::Xaml::UIElement const& element) const; -}; -template <> struct consume { template using type = consume_react_uwp_IDynamicAutomationPropertiesStatics; }; - -template -struct consume_react_uwp_IViewControl -{ - react::uwp::ViewPanel GetPanel() const; -}; -template <> struct consume { template using type = consume_react_uwp_IViewControl; }; - -template -struct consume_react_uwp_IViewPanel -{ - void InsertAt(uint32_t index, Windows::UI::Xaml::UIElement const& value) const; - void RemoveAt(uint32_t index) const; - void Clear() const; - void FinalizeProperties() const; - Windows::UI::Xaml::Controls::Border GetOuterBorder() const; - Windows::UI::Xaml::Media::Brush ViewBackground() const; - void ViewBackground(Windows::UI::Xaml::Media::Brush const& value) const; - Windows::UI::Xaml::Thickness BorderThickness() const; - void BorderThickness(Windows::UI::Xaml::Thickness const& value) const; - Windows::UI::Xaml::Media::Brush BorderBrush() const; - void BorderBrush(Windows::UI::Xaml::Media::Brush const& value) const; - Windows::UI::Xaml::CornerRadius CornerRadius() const; - void CornerRadius(Windows::UI::Xaml::CornerRadius const& value) const; - bool ClipChildren() const; - void ClipChildren(bool value) const; -}; -template <> struct consume { template using type = consume_react_uwp_IViewPanel; }; - -template -struct consume_react_uwp_IViewPanelStatics -{ - Windows::UI::Xaml::DependencyProperty ViewBackgroundProperty() const; - Windows::UI::Xaml::DependencyProperty BorderThicknessProperty() const; - Windows::UI::Xaml::DependencyProperty BorderBrushProperty() const; - Windows::UI::Xaml::DependencyProperty CornerRadiusProperty() const; - Windows::UI::Xaml::DependencyProperty ClipChildrenProperty() const; - Windows::UI::Xaml::DependencyProperty TopProperty() const; - void SetTop(Windows::UI::Xaml::UIElement const& element, double value) const; - double GetTop(Windows::UI::Xaml::UIElement const& element) const; - Windows::UI::Xaml::DependencyProperty LeftProperty() const; - void SetLeft(Windows::UI::Xaml::UIElement const& element, double value) const; - double GetLeft(Windows::UI::Xaml::UIElement const& element) const; -}; -template <> struct consume { template using type = consume_react_uwp_IViewPanelStatics; }; - -struct struct_react_uwp_AccessibilityAction -{ - void* Name; - void* Label; -}; -template <> struct abi{ using type = struct_react_uwp_AccessibilityAction; }; - - -} diff --git a/vnext/ReactUWP/Views/cppwinrt/winrt/impl/react.uwp.1.h b/vnext/ReactUWP/Views/cppwinrt/winrt/impl/react.uwp.1.h deleted file mode 100644 index 64a2e361de4..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/winrt/impl/react.uwp.1.h +++ /dev/null @@ -1,64 +0,0 @@ -// WARNING: Please don't edit this file. It was generated by C++/WinRT v1.0.190111.3 - -#pragma once -#include "winrt/impl/Windows.UI.Xaml.0.h" -#include "winrt/impl/Windows.UI.Xaml.Automation.0.h" -#include "winrt/impl/Windows.UI.Xaml.Automation.Provider.0.h" -#include "winrt/impl/Windows.UI.Xaml.Controls.0.h" -#include "winrt/impl/Windows.UI.Xaml.Media.0.h" -#include "winrt/impl/Windows.UI.Composition.0.h" -#include "winrt/impl/Windows.UI.Xaml.Automation.Peers.0.h" -#include "winrt/impl/react.uwp.0.h" - -WINRT_EXPORT namespace winrt::react::uwp { - -struct WINRT_EBO IDynamicAutomationPeer : - Windows::Foundation::IInspectable, - impl::consume_t -{ - IDynamicAutomationPeer(std::nullptr_t = nullptr) noexcept {} -}; - -struct WINRT_EBO IDynamicAutomationPeerFactory : - Windows::Foundation::IInspectable, - impl::consume_t -{ - IDynamicAutomationPeerFactory(std::nullptr_t = nullptr) noexcept {} -}; - -struct WINRT_EBO IDynamicAutomationProperties : - Windows::Foundation::IInspectable, - impl::consume_t -{ - IDynamicAutomationProperties(std::nullptr_t = nullptr) noexcept {} -}; - -struct WINRT_EBO IDynamicAutomationPropertiesStatics : - Windows::Foundation::IInspectable, - impl::consume_t -{ - IDynamicAutomationPropertiesStatics(std::nullptr_t = nullptr) noexcept {} -}; - -struct WINRT_EBO IViewControl : - Windows::Foundation::IInspectable, - impl::consume_t -{ - IViewControl(std::nullptr_t = nullptr) noexcept {} -}; - -struct WINRT_EBO IViewPanel : - Windows::Foundation::IInspectable, - impl::consume_t -{ - IViewPanel(std::nullptr_t = nullptr) noexcept {} -}; - -struct WINRT_EBO IViewPanelStatics : - Windows::Foundation::IInspectable, - impl::consume_t -{ - IViewPanelStatics(std::nullptr_t = nullptr) noexcept {} -}; - -} diff --git a/vnext/ReactUWP/Views/cppwinrt/winrt/impl/react.uwp.2.h b/vnext/ReactUWP/Views/cppwinrt/winrt/impl/react.uwp.2.h deleted file mode 100644 index cd02ba0d77f..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/winrt/impl/react.uwp.2.h +++ /dev/null @@ -1,138 +0,0 @@ -// WARNING: Please don't edit this file. It was generated by C++/WinRT v1.0.190111.3 - -#pragma once -#include "winrt/impl/Windows.UI.Xaml.1.h" -#include "winrt/impl/Windows.UI.Xaml.Automation.1.h" -#include "winrt/impl/Windows.UI.Xaml.Automation.Provider.1.h" -#include "winrt/impl/Windows.UI.Xaml.Controls.1.h" -#include "winrt/impl/Windows.UI.Xaml.Media.1.h" -#include "winrt/impl/Windows.UI.Composition.1.h" -#include "winrt/impl/Windows.UI.Xaml.Automation.Peers.1.h" -#include "winrt/impl/react.uwp.1.h" - -WINRT_EXPORT namespace winrt::react::uwp { - -struct AccessibilityActionEventHandler : Windows::Foundation::IUnknown -{ - AccessibilityActionEventHandler(std::nullptr_t = nullptr) noexcept {} - template AccessibilityActionEventHandler(L lambda); - template AccessibilityActionEventHandler(F* function); - template AccessibilityActionEventHandler(O* object, M method); - template AccessibilityActionEventHandler(com_ptr&& object, M method); - template AccessibilityActionEventHandler(weak_ref&& object, M method); - void operator()(react::uwp::AccessibilityAction const& action) const; -}; - -struct AccessibilityInvokeEventHandler : Windows::Foundation::IUnknown -{ - AccessibilityInvokeEventHandler(std::nullptr_t = nullptr) noexcept {} - template AccessibilityInvokeEventHandler(L lambda); - template AccessibilityInvokeEventHandler(F* function); - template AccessibilityInvokeEventHandler(O* object, M method); - template AccessibilityInvokeEventHandler(com_ptr&& object, M method); - template AccessibilityInvokeEventHandler(weak_ref&& object, M method); - void operator()() const; -}; - -struct AccessibilityAction -{ - hstring Name; - hstring Label; -}; - -inline bool operator==(AccessibilityAction const& left, AccessibilityAction const& right) noexcept -{ - return left.Name == right.Name && left.Label == right.Label; -} - -inline bool operator!=(AccessibilityAction const& left, AccessibilityAction const& right) noexcept -{ - return !(left == right); -} - -} - -namespace winrt::impl { - -} - -WINRT_EXPORT namespace winrt::react::uwp { - -struct WINRT_EBO DynamicAutomationPeer : - react::uwp::IDynamicAutomationPeer, - impl::base, - impl::require -{ - DynamicAutomationPeer(std::nullptr_t) noexcept {} - DynamicAutomationPeer(Windows::UI::Xaml::FrameworkElement const& owner); -}; - -struct WINRT_EBO DynamicAutomationProperties : - react::uwp::IDynamicAutomationProperties -{ - DynamicAutomationProperties(std::nullptr_t) noexcept {} - static Windows::UI::Xaml::DependencyProperty AccessibilityRoleProperty(); - static void SetAccessibilityRole(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityRoles const& value); - static react::uwp::AccessibilityRoles GetAccessibilityRole(Windows::UI::Xaml::UIElement const& element); - static Windows::UI::Xaml::DependencyProperty AccessibilityStateSelectedProperty(); - static void SetAccessibilityStateSelected(Windows::UI::Xaml::UIElement const& element, bool value); - static bool GetAccessibilityStateSelected(Windows::UI::Xaml::UIElement const& element); - static Windows::UI::Xaml::DependencyProperty AccessibilityStateDisabledProperty(); - static void SetAccessibilityStateDisabled(Windows::UI::Xaml::UIElement const& element, bool value); - static bool GetAccessibilityStateDisabled(Windows::UI::Xaml::UIElement const& element); - static Windows::UI::Xaml::DependencyProperty AccessibilityStateCheckedProperty(); - static void SetAccessibilityStateChecked(Windows::UI::Xaml::UIElement const& element, bool value); - static bool GetAccessibilityStateChecked(Windows::UI::Xaml::UIElement const& element); - static Windows::UI::Xaml::DependencyProperty AccessibilityStateUncheckedProperty(); - static void SetAccessibilityStateUnchecked(Windows::UI::Xaml::UIElement const& element, bool value); - static bool GetAccessibilityStateUnchecked(Windows::UI::Xaml::UIElement const& element); - static Windows::UI::Xaml::DependencyProperty AccessibilityStateBusyProperty(); - static void SetAccessibilityStateBusy(Windows::UI::Xaml::UIElement const& element, bool value); - static bool GetAccessibilityStateBusy(Windows::UI::Xaml::UIElement const& element); - static Windows::UI::Xaml::DependencyProperty AccessibilityStateExpandedProperty(); - static void SetAccessibilityStateExpanded(Windows::UI::Xaml::UIElement const& element, bool value); - static bool GetAccessibilityStateExpanded(Windows::UI::Xaml::UIElement const& element); - static Windows::UI::Xaml::DependencyProperty AccessibilityStateCollapsedProperty(); - static void SetAccessibilityStateCollapsed(Windows::UI::Xaml::UIElement const& element, bool value); - static bool GetAccessibilityStateCollapsed(Windows::UI::Xaml::UIElement const& element); - static Windows::UI::Xaml::DependencyProperty AccessibilityInvokeEventHandlerProperty(); - static void SetAccessibilityInvokeEventHandler(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityInvokeEventHandler const& value); - static react::uwp::AccessibilityInvokeEventHandler GetAccessibilityInvokeEventHandler(Windows::UI::Xaml::UIElement const& element); - static Windows::UI::Xaml::DependencyProperty AccessibilityActionsProperty(); - static void SetAccessibilityActions(Windows::UI::Xaml::UIElement const& element, param::vector const& value); - static Windows::Foundation::Collections::IVector GetAccessibilityActions(Windows::UI::Xaml::UIElement const& element); - static Windows::UI::Xaml::DependencyProperty AccessibilityActionEventHandlerProperty(); - static void SetAccessibilityActionEventHandler(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityActionEventHandler const& value); - static react::uwp::AccessibilityActionEventHandler GetAccessibilityActionEventHandler(Windows::UI::Xaml::UIElement const& element); -}; - -struct WINRT_EBO ViewControl : - react::uwp::IViewControl, - impl::base, - impl::require -{ - ViewControl(std::nullptr_t) noexcept {} - ViewControl(); -}; - -struct WINRT_EBO ViewPanel : - react::uwp::IViewPanel, - impl::base, - impl::require -{ - ViewPanel(std::nullptr_t) noexcept {} - ViewPanel(); - static Windows::UI::Xaml::DependencyProperty ViewBackgroundProperty(); - static Windows::UI::Xaml::DependencyProperty BorderThicknessProperty(); - static Windows::UI::Xaml::DependencyProperty BorderBrushProperty(); - static Windows::UI::Xaml::DependencyProperty CornerRadiusProperty(); - static Windows::UI::Xaml::DependencyProperty ClipChildrenProperty(); - static Windows::UI::Xaml::DependencyProperty TopProperty(); - static void SetTop(Windows::UI::Xaml::UIElement const& element, double value); - static double GetTop(Windows::UI::Xaml::UIElement const& element); - static Windows::UI::Xaml::DependencyProperty LeftProperty(); - static void SetLeft(Windows::UI::Xaml::UIElement const& element, double value); - static double GetLeft(Windows::UI::Xaml::UIElement const& element); -}; - -} diff --git a/vnext/ReactUWP/Views/cppwinrt/winrt/react.uwp.h b/vnext/ReactUWP/Views/cppwinrt/winrt/react.uwp.h deleted file mode 100644 index f69b7d02b16..00000000000 --- a/vnext/ReactUWP/Views/cppwinrt/winrt/react.uwp.h +++ /dev/null @@ -1,2651 +0,0 @@ -// WARNING: Please don't edit this file. It was generated by C++/WinRT v1.0.190111.3 - -#pragma once - -#include "winrt/base.h" - - -static_assert(winrt::check_version(CPPWINRT_VERSION, "1.0.190111.3"), "Mismatched component and base headers."); -#include "winrt/Windows.Foundation.h" -#include "winrt/Windows.Foundation.Collections.h" -#include "winrt/impl/Windows.UI.Xaml.2.h" -#include "winrt/impl/Windows.UI.Xaml.Automation.2.h" -#include "winrt/impl/Windows.UI.Xaml.Automation.Provider.2.h" -#include "winrt/impl/Windows.UI.Xaml.Controls.2.h" -#include "winrt/impl/Windows.UI.Xaml.Media.2.h" -#include "winrt/impl/Windows.UI.Composition.2.h" -#include "winrt/impl/Windows.UI.Xaml.Automation.Peers.2.h" -#include "winrt/impl/react.uwp.2.h" - -namespace winrt::impl { - -template react::uwp::DynamicAutomationPeer consume_react_uwp_IDynamicAutomationPeerFactory::CreateInstance(Windows::UI::Xaml::FrameworkElement const& owner) const -{ - react::uwp::DynamicAutomationPeer value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPeerFactory)->CreateInstance(get_abi(owner), put_abi(value))); - return value; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IDynamicAutomationPropertiesStatics::AccessibilityRoleProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->get_AccessibilityRoleProperty(put_abi(value))); - return value; -} - -template void consume_react_uwp_IDynamicAutomationPropertiesStatics::SetAccessibilityRole(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityRoles const& value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->SetAccessibilityRole(get_abi(element), get_abi(value))); -} - -template react::uwp::AccessibilityRoles consume_react_uwp_IDynamicAutomationPropertiesStatics::GetAccessibilityRole(Windows::UI::Xaml::UIElement const& element) const -{ - react::uwp::AccessibilityRoles result{}; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->GetAccessibilityRole(get_abi(element), put_abi(result))); - return result; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IDynamicAutomationPropertiesStatics::AccessibilityStateSelectedProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->get_AccessibilityStateSelectedProperty(put_abi(value))); - return value; -} - -template void consume_react_uwp_IDynamicAutomationPropertiesStatics::SetAccessibilityStateSelected(Windows::UI::Xaml::UIElement const& element, bool value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->SetAccessibilityStateSelected(get_abi(element), value)); -} - -template bool consume_react_uwp_IDynamicAutomationPropertiesStatics::GetAccessibilityStateSelected(Windows::UI::Xaml::UIElement const& element) const -{ - bool result{}; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->GetAccessibilityStateSelected(get_abi(element), &result)); - return result; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IDynamicAutomationPropertiesStatics::AccessibilityStateDisabledProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->get_AccessibilityStateDisabledProperty(put_abi(value))); - return value; -} - -template void consume_react_uwp_IDynamicAutomationPropertiesStatics::SetAccessibilityStateDisabled(Windows::UI::Xaml::UIElement const& element, bool value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->SetAccessibilityStateDisabled(get_abi(element), value)); -} - -template bool consume_react_uwp_IDynamicAutomationPropertiesStatics::GetAccessibilityStateDisabled(Windows::UI::Xaml::UIElement const& element) const -{ - bool result{}; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->GetAccessibilityStateDisabled(get_abi(element), &result)); - return result; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IDynamicAutomationPropertiesStatics::AccessibilityStateCheckedProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->get_AccessibilityStateCheckedProperty(put_abi(value))); - return value; -} - -template void consume_react_uwp_IDynamicAutomationPropertiesStatics::SetAccessibilityStateChecked(Windows::UI::Xaml::UIElement const& element, bool value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->SetAccessibilityStateChecked(get_abi(element), value)); -} - -template bool consume_react_uwp_IDynamicAutomationPropertiesStatics::GetAccessibilityStateChecked(Windows::UI::Xaml::UIElement const& element) const -{ - bool result{}; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->GetAccessibilityStateChecked(get_abi(element), &result)); - return result; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IDynamicAutomationPropertiesStatics::AccessibilityStateUncheckedProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->get_AccessibilityStateUncheckedProperty(put_abi(value))); - return value; -} - -template void consume_react_uwp_IDynamicAutomationPropertiesStatics::SetAccessibilityStateUnchecked(Windows::UI::Xaml::UIElement const& element, bool value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->SetAccessibilityStateUnchecked(get_abi(element), value)); -} - -template bool consume_react_uwp_IDynamicAutomationPropertiesStatics::GetAccessibilityStateUnchecked(Windows::UI::Xaml::UIElement const& element) const -{ - bool result{}; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->GetAccessibilityStateUnchecked(get_abi(element), &result)); - return result; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IDynamicAutomationPropertiesStatics::AccessibilityStateBusyProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->get_AccessibilityStateBusyProperty(put_abi(value))); - return value; -} - -template void consume_react_uwp_IDynamicAutomationPropertiesStatics::SetAccessibilityStateBusy(Windows::UI::Xaml::UIElement const& element, bool value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->SetAccessibilityStateBusy(get_abi(element), value)); -} - -template bool consume_react_uwp_IDynamicAutomationPropertiesStatics::GetAccessibilityStateBusy(Windows::UI::Xaml::UIElement const& element) const -{ - bool result{}; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->GetAccessibilityStateBusy(get_abi(element), &result)); - return result; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IDynamicAutomationPropertiesStatics::AccessibilityStateExpandedProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->get_AccessibilityStateExpandedProperty(put_abi(value))); - return value; -} - -template void consume_react_uwp_IDynamicAutomationPropertiesStatics::SetAccessibilityStateExpanded(Windows::UI::Xaml::UIElement const& element, bool value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->SetAccessibilityStateExpanded(get_abi(element), value)); -} - -template bool consume_react_uwp_IDynamicAutomationPropertiesStatics::GetAccessibilityStateExpanded(Windows::UI::Xaml::UIElement const& element) const -{ - bool result{}; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->GetAccessibilityStateExpanded(get_abi(element), &result)); - return result; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IDynamicAutomationPropertiesStatics::AccessibilityStateCollapsedProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->get_AccessibilityStateCollapsedProperty(put_abi(value))); - return value; -} - -template void consume_react_uwp_IDynamicAutomationPropertiesStatics::SetAccessibilityStateCollapsed(Windows::UI::Xaml::UIElement const& element, bool value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->SetAccessibilityStateCollapsed(get_abi(element), value)); -} - -template bool consume_react_uwp_IDynamicAutomationPropertiesStatics::GetAccessibilityStateCollapsed(Windows::UI::Xaml::UIElement const& element) const -{ - bool result{}; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->GetAccessibilityStateCollapsed(get_abi(element), &result)); - return result; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IDynamicAutomationPropertiesStatics::AccessibilityInvokeEventHandlerProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->get_AccessibilityInvokeEventHandlerProperty(put_abi(value))); - return value; -} - -template void consume_react_uwp_IDynamicAutomationPropertiesStatics::SetAccessibilityInvokeEventHandler(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityInvokeEventHandler const& value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->SetAccessibilityInvokeEventHandler(get_abi(element), get_abi(value))); -} - -template react::uwp::AccessibilityInvokeEventHandler consume_react_uwp_IDynamicAutomationPropertiesStatics::GetAccessibilityInvokeEventHandler(Windows::UI::Xaml::UIElement const& element) const -{ - react::uwp::AccessibilityInvokeEventHandler result{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->GetAccessibilityInvokeEventHandler(get_abi(element), put_abi(result))); - return result; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IDynamicAutomationPropertiesStatics::AccessibilityActionsProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->get_AccessibilityActionsProperty(put_abi(value))); - return value; -} - -template void consume_react_uwp_IDynamicAutomationPropertiesStatics::SetAccessibilityActions(Windows::UI::Xaml::UIElement const& element, param::vector const& value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->SetAccessibilityActions(get_abi(element), get_abi(value))); -} - -template Windows::Foundation::Collections::IVector consume_react_uwp_IDynamicAutomationPropertiesStatics::GetAccessibilityActions(Windows::UI::Xaml::UIElement const& element) const -{ - Windows::Foundation::Collections::IVector result{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->GetAccessibilityActions(get_abi(element), put_abi(result))); - return result; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IDynamicAutomationPropertiesStatics::AccessibilityActionEventHandlerProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->get_AccessibilityActionEventHandlerProperty(put_abi(value))); - return value; -} - -template void consume_react_uwp_IDynamicAutomationPropertiesStatics::SetAccessibilityActionEventHandler(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityActionEventHandler const& value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->SetAccessibilityActionEventHandler(get_abi(element), get_abi(value))); -} - -template react::uwp::AccessibilityActionEventHandler consume_react_uwp_IDynamicAutomationPropertiesStatics::GetAccessibilityActionEventHandler(Windows::UI::Xaml::UIElement const& element) const -{ - react::uwp::AccessibilityActionEventHandler result{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)->GetAccessibilityActionEventHandler(get_abi(element), put_abi(result))); - return result; -} - -template react::uwp::ViewPanel consume_react_uwp_IViewControl::GetPanel() const -{ - react::uwp::ViewPanel result{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IViewControl)->GetPanel(put_abi(result))); - return result; -} - -template void consume_react_uwp_IViewPanel::InsertAt(uint32_t index, Windows::UI::Xaml::UIElement const& value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->InsertAt(index, get_abi(value))); -} - -template void consume_react_uwp_IViewPanel::RemoveAt(uint32_t index) const -{ - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->RemoveAt(index)); -} - -template void consume_react_uwp_IViewPanel::Clear() const -{ - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->Clear()); -} - -template void consume_react_uwp_IViewPanel::FinalizeProperties() const -{ - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->FinalizeProperties()); -} - -template Windows::UI::Xaml::Controls::Border consume_react_uwp_IViewPanel::GetOuterBorder() const -{ - Windows::UI::Xaml::Controls::Border result{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->GetOuterBorder(put_abi(result))); - return result; -} - -template Windows::UI::Xaml::Media::Brush consume_react_uwp_IViewPanel::ViewBackground() const -{ - Windows::UI::Xaml::Media::Brush value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->get_ViewBackground(put_abi(value))); - return value; -} - -template void consume_react_uwp_IViewPanel::ViewBackground(Windows::UI::Xaml::Media::Brush const& value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->put_ViewBackground(get_abi(value))); -} - -template Windows::UI::Xaml::Thickness consume_react_uwp_IViewPanel::BorderThickness() const -{ - Windows::UI::Xaml::Thickness value{}; - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->get_BorderThickness(put_abi(value))); - return value; -} - -template void consume_react_uwp_IViewPanel::BorderThickness(Windows::UI::Xaml::Thickness const& value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->put_BorderThickness(get_abi(value))); -} - -template Windows::UI::Xaml::Media::Brush consume_react_uwp_IViewPanel::BorderBrush() const -{ - Windows::UI::Xaml::Media::Brush value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->get_BorderBrush(put_abi(value))); - return value; -} - -template void consume_react_uwp_IViewPanel::BorderBrush(Windows::UI::Xaml::Media::Brush const& value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->put_BorderBrush(get_abi(value))); -} - -template Windows::UI::Xaml::CornerRadius consume_react_uwp_IViewPanel::CornerRadius() const -{ - Windows::UI::Xaml::CornerRadius value{}; - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->get_CornerRadius(put_abi(value))); - return value; -} - -template void consume_react_uwp_IViewPanel::CornerRadius(Windows::UI::Xaml::CornerRadius const& value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->put_CornerRadius(get_abi(value))); -} - -template bool consume_react_uwp_IViewPanel::ClipChildren() const -{ - bool value{}; - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->get_ClipChildren(&value)); - return value; -} - -template void consume_react_uwp_IViewPanel::ClipChildren(bool value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->put_ClipChildren(value)); -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IViewPanelStatics::ViewBackgroundProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)->get_ViewBackgroundProperty(put_abi(value))); - return value; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IViewPanelStatics::BorderThicknessProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)->get_BorderThicknessProperty(put_abi(value))); - return value; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IViewPanelStatics::BorderBrushProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)->get_BorderBrushProperty(put_abi(value))); - return value; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IViewPanelStatics::CornerRadiusProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)->get_CornerRadiusProperty(put_abi(value))); - return value; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IViewPanelStatics::ClipChildrenProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)->get_ClipChildrenProperty(put_abi(value))); - return value; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IViewPanelStatics::TopProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)->get_TopProperty(put_abi(value))); - return value; -} - -template void consume_react_uwp_IViewPanelStatics::SetTop(Windows::UI::Xaml::UIElement const& element, double value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)->SetTop(get_abi(element), value)); -} - -template double consume_react_uwp_IViewPanelStatics::GetTop(Windows::UI::Xaml::UIElement const& element) const -{ - double result{}; - check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)->GetTop(get_abi(element), &result)); - return result; -} - -template Windows::UI::Xaml::DependencyProperty consume_react_uwp_IViewPanelStatics::LeftProperty() const -{ - Windows::UI::Xaml::DependencyProperty value{ nullptr }; - check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)->get_LeftProperty(put_abi(value))); - return value; -} - -template void consume_react_uwp_IViewPanelStatics::SetLeft(Windows::UI::Xaml::UIElement const& element, double value) const -{ - check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)->SetLeft(get_abi(element), value)); -} - -template double consume_react_uwp_IViewPanelStatics::GetLeft(Windows::UI::Xaml::UIElement const& element) const -{ - double result{}; - check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)->GetLeft(get_abi(element), &result)); - return result; -} - -template <> struct delegate -{ - template - struct type : implements_delegate - { - type(H&& handler) : implements_delegate(std::forward(handler)) {} - - int32_t WINRT_CALL Invoke(struct struct_react_uwp_AccessibilityAction action) noexcept final - { - try - { - (*this)(*reinterpret_cast(&action)); - return 0; - } - catch (...) - { - return to_hresult(); - } - } - }; -}; - -template <> struct delegate -{ - template - struct type : implements_delegate - { - type(H&& handler) : implements_delegate(std::forward(handler)) {} - - int32_t WINRT_CALL Invoke() noexcept final - { - try - { - (*this)(); - return 0; - } - catch (...) - { - return to_hresult(); - } - } - }; -}; - -template -struct produce : produce_base -{}; - -template -struct produce : produce_base -{ - int32_t WINRT_CALL CreateInstance(void* owner, void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(CreateInstance, WINRT_WRAP(react::uwp::DynamicAutomationPeer), Windows::UI::Xaml::FrameworkElement const&); - *value = detach_from(this->shim().CreateInstance(*reinterpret_cast(&owner))); - return 0; - } - catch (...) { return to_hresult(); } - } -}; - -template -struct produce : produce_base -{}; - -template -struct produce : produce_base -{ - int32_t WINRT_CALL get_AccessibilityRoleProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(AccessibilityRoleProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().AccessibilityRoleProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL SetAccessibilityRole(void* element, react::uwp::AccessibilityRoles value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(SetAccessibilityRole, WINRT_WRAP(void), Windows::UI::Xaml::UIElement const&, react::uwp::AccessibilityRoles const&); - this->shim().SetAccessibilityRole(*reinterpret_cast(&element), *reinterpret_cast(&value)); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetAccessibilityRole(void* element, react::uwp::AccessibilityRoles* result) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetAccessibilityRole, WINRT_WRAP(react::uwp::AccessibilityRoles), Windows::UI::Xaml::UIElement const&); - *result = detach_from(this->shim().GetAccessibilityRole(*reinterpret_cast(&element))); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_AccessibilityStateSelectedProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(AccessibilityStateSelectedProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().AccessibilityStateSelectedProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL SetAccessibilityStateSelected(void* element, bool value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(SetAccessibilityStateSelected, WINRT_WRAP(void), Windows::UI::Xaml::UIElement const&, bool); - this->shim().SetAccessibilityStateSelected(*reinterpret_cast(&element), value); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetAccessibilityStateSelected(void* element, bool* result) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetAccessibilityStateSelected, WINRT_WRAP(bool), Windows::UI::Xaml::UIElement const&); - *result = detach_from(this->shim().GetAccessibilityStateSelected(*reinterpret_cast(&element))); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_AccessibilityStateDisabledProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(AccessibilityStateDisabledProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().AccessibilityStateDisabledProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL SetAccessibilityStateDisabled(void* element, bool value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(SetAccessibilityStateDisabled, WINRT_WRAP(void), Windows::UI::Xaml::UIElement const&, bool); - this->shim().SetAccessibilityStateDisabled(*reinterpret_cast(&element), value); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetAccessibilityStateDisabled(void* element, bool* result) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetAccessibilityStateDisabled, WINRT_WRAP(bool), Windows::UI::Xaml::UIElement const&); - *result = detach_from(this->shim().GetAccessibilityStateDisabled(*reinterpret_cast(&element))); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_AccessibilityStateCheckedProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(AccessibilityStateCheckedProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().AccessibilityStateCheckedProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL SetAccessibilityStateChecked(void* element, bool value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(SetAccessibilityStateChecked, WINRT_WRAP(void), Windows::UI::Xaml::UIElement const&, bool); - this->shim().SetAccessibilityStateChecked(*reinterpret_cast(&element), value); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetAccessibilityStateChecked(void* element, bool* result) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetAccessibilityStateChecked, WINRT_WRAP(bool), Windows::UI::Xaml::UIElement const&); - *result = detach_from(this->shim().GetAccessibilityStateChecked(*reinterpret_cast(&element))); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_AccessibilityStateUncheckedProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(AccessibilityStateUncheckedProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().AccessibilityStateUncheckedProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL SetAccessibilityStateUnchecked(void* element, bool value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(SetAccessibilityStateUnchecked, WINRT_WRAP(void), Windows::UI::Xaml::UIElement const&, bool); - this->shim().SetAccessibilityStateUnchecked(*reinterpret_cast(&element), value); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetAccessibilityStateUnchecked(void* element, bool* result) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetAccessibilityStateUnchecked, WINRT_WRAP(bool), Windows::UI::Xaml::UIElement const&); - *result = detach_from(this->shim().GetAccessibilityStateUnchecked(*reinterpret_cast(&element))); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_AccessibilityStateBusyProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(AccessibilityStateBusyProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().AccessibilityStateBusyProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL SetAccessibilityStateBusy(void* element, bool value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(SetAccessibilityStateBusy, WINRT_WRAP(void), Windows::UI::Xaml::UIElement const&, bool); - this->shim().SetAccessibilityStateBusy(*reinterpret_cast(&element), value); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetAccessibilityStateBusy(void* element, bool* result) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetAccessibilityStateBusy, WINRT_WRAP(bool), Windows::UI::Xaml::UIElement const&); - *result = detach_from(this->shim().GetAccessibilityStateBusy(*reinterpret_cast(&element))); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_AccessibilityStateExpandedProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(AccessibilityStateExpandedProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().AccessibilityStateExpandedProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL SetAccessibilityStateExpanded(void* element, bool value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(SetAccessibilityStateExpanded, WINRT_WRAP(void), Windows::UI::Xaml::UIElement const&, bool); - this->shim().SetAccessibilityStateExpanded(*reinterpret_cast(&element), value); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetAccessibilityStateExpanded(void* element, bool* result) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetAccessibilityStateExpanded, WINRT_WRAP(bool), Windows::UI::Xaml::UIElement const&); - *result = detach_from(this->shim().GetAccessibilityStateExpanded(*reinterpret_cast(&element))); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_AccessibilityStateCollapsedProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(AccessibilityStateCollapsedProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().AccessibilityStateCollapsedProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL SetAccessibilityStateCollapsed(void* element, bool value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(SetAccessibilityStateCollapsed, WINRT_WRAP(void), Windows::UI::Xaml::UIElement const&, bool); - this->shim().SetAccessibilityStateCollapsed(*reinterpret_cast(&element), value); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetAccessibilityStateCollapsed(void* element, bool* result) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetAccessibilityStateCollapsed, WINRT_WRAP(bool), Windows::UI::Xaml::UIElement const&); - *result = detach_from(this->shim().GetAccessibilityStateCollapsed(*reinterpret_cast(&element))); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_AccessibilityInvokeEventHandlerProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(AccessibilityInvokeEventHandlerProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().AccessibilityInvokeEventHandlerProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL SetAccessibilityInvokeEventHandler(void* element, void* value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(SetAccessibilityInvokeEventHandler, WINRT_WRAP(void), Windows::UI::Xaml::UIElement const&, react::uwp::AccessibilityInvokeEventHandler const&); - this->shim().SetAccessibilityInvokeEventHandler(*reinterpret_cast(&element), *reinterpret_cast(&value)); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetAccessibilityInvokeEventHandler(void* element, void** result) noexcept final - { - try - { - *result = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetAccessibilityInvokeEventHandler, WINRT_WRAP(react::uwp::AccessibilityInvokeEventHandler), Windows::UI::Xaml::UIElement const&); - *result = detach_from(this->shim().GetAccessibilityInvokeEventHandler(*reinterpret_cast(&element))); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_AccessibilityActionsProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(AccessibilityActionsProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().AccessibilityActionsProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL SetAccessibilityActions(void* element, void* value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(SetAccessibilityActions, WINRT_WRAP(void), Windows::UI::Xaml::UIElement const&, Windows::Foundation::Collections::IVector const&); - this->shim().SetAccessibilityActions(*reinterpret_cast(&element), *reinterpret_cast const*>(&value)); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetAccessibilityActions(void* element, void** result) noexcept final - { - try - { - *result = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetAccessibilityActions, WINRT_WRAP(Windows::Foundation::Collections::IVector), Windows::UI::Xaml::UIElement const&); - *result = detach_from>(this->shim().GetAccessibilityActions(*reinterpret_cast(&element))); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_AccessibilityActionEventHandlerProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(AccessibilityActionEventHandlerProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().AccessibilityActionEventHandlerProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL SetAccessibilityActionEventHandler(void* element, void* value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(SetAccessibilityActionEventHandler, WINRT_WRAP(void), Windows::UI::Xaml::UIElement const&, react::uwp::AccessibilityActionEventHandler const&); - this->shim().SetAccessibilityActionEventHandler(*reinterpret_cast(&element), *reinterpret_cast(&value)); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetAccessibilityActionEventHandler(void* element, void** result) noexcept final - { - try - { - *result = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetAccessibilityActionEventHandler, WINRT_WRAP(react::uwp::AccessibilityActionEventHandler), Windows::UI::Xaml::UIElement const&); - *result = detach_from(this->shim().GetAccessibilityActionEventHandler(*reinterpret_cast(&element))); - return 0; - } - catch (...) { return to_hresult(); } - } -}; - -template -struct produce : produce_base -{ - int32_t WINRT_CALL GetPanel(void** result) noexcept final - { - try - { - *result = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetPanel, WINRT_WRAP(react::uwp::ViewPanel)); - *result = detach_from(this->shim().GetPanel()); - return 0; - } - catch (...) { return to_hresult(); } - } -}; - -template -struct produce : produce_base -{ - int32_t WINRT_CALL InsertAt(uint32_t index, void* value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(InsertAt, WINRT_WRAP(void), uint32_t, Windows::UI::Xaml::UIElement const&); - this->shim().InsertAt(index, *reinterpret_cast(&value)); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL RemoveAt(uint32_t index) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(RemoveAt, WINRT_WRAP(void), uint32_t); - this->shim().RemoveAt(index); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL Clear() noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(Clear, WINRT_WRAP(void)); - this->shim().Clear(); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL FinalizeProperties() noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(FinalizeProperties, WINRT_WRAP(void)); - this->shim().FinalizeProperties(); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetOuterBorder(void** result) noexcept final - { - try - { - *result = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetOuterBorder, WINRT_WRAP(Windows::UI::Xaml::Controls::Border)); - *result = detach_from(this->shim().GetOuterBorder()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_ViewBackground(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(ViewBackground, WINRT_WRAP(Windows::UI::Xaml::Media::Brush)); - *value = detach_from(this->shim().ViewBackground()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL put_ViewBackground(void* value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(ViewBackground, WINRT_WRAP(void), Windows::UI::Xaml::Media::Brush const&); - this->shim().ViewBackground(*reinterpret_cast(&value)); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_BorderThickness(struct struct_Windows_UI_Xaml_Thickness* value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(BorderThickness, WINRT_WRAP(Windows::UI::Xaml::Thickness)); - *value = detach_from(this->shim().BorderThickness()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL put_BorderThickness(struct struct_Windows_UI_Xaml_Thickness value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(BorderThickness, WINRT_WRAP(void), Windows::UI::Xaml::Thickness const&); - this->shim().BorderThickness(*reinterpret_cast(&value)); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_BorderBrush(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(BorderBrush, WINRT_WRAP(Windows::UI::Xaml::Media::Brush)); - *value = detach_from(this->shim().BorderBrush()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL put_BorderBrush(void* value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(BorderBrush, WINRT_WRAP(void), Windows::UI::Xaml::Media::Brush const&); - this->shim().BorderBrush(*reinterpret_cast(&value)); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_CornerRadius(struct struct_Windows_UI_Xaml_CornerRadius* value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(CornerRadius, WINRT_WRAP(Windows::UI::Xaml::CornerRadius)); - *value = detach_from(this->shim().CornerRadius()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL put_CornerRadius(struct struct_Windows_UI_Xaml_CornerRadius value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(CornerRadius, WINRT_WRAP(void), Windows::UI::Xaml::CornerRadius const&); - this->shim().CornerRadius(*reinterpret_cast(&value)); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_ClipChildren(bool* value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(ClipChildren, WINRT_WRAP(bool)); - *value = detach_from(this->shim().ClipChildren()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL put_ClipChildren(bool value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(ClipChildren, WINRT_WRAP(void), bool); - this->shim().ClipChildren(value); - return 0; - } - catch (...) { return to_hresult(); } - } -}; - -template -struct produce : produce_base -{ - int32_t WINRT_CALL get_ViewBackgroundProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(ViewBackgroundProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().ViewBackgroundProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_BorderThicknessProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(BorderThicknessProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().BorderThicknessProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_BorderBrushProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(BorderBrushProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().BorderBrushProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_CornerRadiusProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(CornerRadiusProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().CornerRadiusProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_ClipChildrenProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(ClipChildrenProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().ClipChildrenProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_TopProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(TopProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().TopProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL SetTop(void* element, double value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(SetTop, WINRT_WRAP(void), Windows::UI::Xaml::UIElement const&, double); - this->shim().SetTop(*reinterpret_cast(&element), value); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetTop(void* element, double* result) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetTop, WINRT_WRAP(double), Windows::UI::Xaml::UIElement const&); - *result = detach_from(this->shim().GetTop(*reinterpret_cast(&element))); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL get_LeftProperty(void** value) noexcept final - { - try - { - *value = nullptr; - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(LeftProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty)); - *value = detach_from(this->shim().LeftProperty()); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL SetLeft(void* element, double value) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(SetLeft, WINRT_WRAP(void), Windows::UI::Xaml::UIElement const&, double); - this->shim().SetLeft(*reinterpret_cast(&element), value); - return 0; - } - catch (...) { return to_hresult(); } - } - - int32_t WINRT_CALL GetLeft(void* element, double* result) noexcept final - { - try - { - typename D::abi_guard guard(this->shim()); - WINRT_ASSERT_DECLARATION(GetLeft, WINRT_WRAP(double), Windows::UI::Xaml::UIElement const&); - *result = detach_from(this->shim().GetLeft(*reinterpret_cast(&element))); - return 0; - } - catch (...) { return to_hresult(); } - } -}; - -} - -WINRT_EXPORT namespace winrt::react::uwp { - -inline DynamicAutomationPeer::DynamicAutomationPeer(Windows::UI::Xaml::FrameworkElement const& owner) : - DynamicAutomationPeer(impl::call_factory([&](auto&& f) { return f.CreateInstance(owner); })) -{} - -inline Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityRoleProperty() -{ - return impl::call_factory([&](auto&& f) { return f.AccessibilityRoleProperty(); }); -} - -inline void DynamicAutomationProperties::SetAccessibilityRole(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityRoles const& value) -{ - impl::call_factory([&](auto&& f) { return f.SetAccessibilityRole(element, value); }); -} - -inline react::uwp::AccessibilityRoles DynamicAutomationProperties::GetAccessibilityRole(Windows::UI::Xaml::UIElement const& element) -{ - return impl::call_factory([&](auto&& f) { return f.GetAccessibilityRole(element); }); -} - -inline Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityStateSelectedProperty() -{ - return impl::call_factory([&](auto&& f) { return f.AccessibilityStateSelectedProperty(); }); -} - -inline void DynamicAutomationProperties::SetAccessibilityStateSelected(Windows::UI::Xaml::UIElement const& element, bool value) -{ - impl::call_factory([&](auto&& f) { return f.SetAccessibilityStateSelected(element, value); }); -} - -inline bool DynamicAutomationProperties::GetAccessibilityStateSelected(Windows::UI::Xaml::UIElement const& element) -{ - return impl::call_factory([&](auto&& f) { return f.GetAccessibilityStateSelected(element); }); -} - -inline Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityStateDisabledProperty() -{ - return impl::call_factory([&](auto&& f) { return f.AccessibilityStateDisabledProperty(); }); -} - -inline void DynamicAutomationProperties::SetAccessibilityStateDisabled(Windows::UI::Xaml::UIElement const& element, bool value) -{ - impl::call_factory([&](auto&& f) { return f.SetAccessibilityStateDisabled(element, value); }); -} - -inline bool DynamicAutomationProperties::GetAccessibilityStateDisabled(Windows::UI::Xaml::UIElement const& element) -{ - return impl::call_factory([&](auto&& f) { return f.GetAccessibilityStateDisabled(element); }); -} - -inline Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityStateCheckedProperty() -{ - return impl::call_factory([&](auto&& f) { return f.AccessibilityStateCheckedProperty(); }); -} - -inline void DynamicAutomationProperties::SetAccessibilityStateChecked(Windows::UI::Xaml::UIElement const& element, bool value) -{ - impl::call_factory([&](auto&& f) { return f.SetAccessibilityStateChecked(element, value); }); -} - -inline bool DynamicAutomationProperties::GetAccessibilityStateChecked(Windows::UI::Xaml::UIElement const& element) -{ - return impl::call_factory([&](auto&& f) { return f.GetAccessibilityStateChecked(element); }); -} - -inline Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityStateUncheckedProperty() -{ - return impl::call_factory([&](auto&& f) { return f.AccessibilityStateUncheckedProperty(); }); -} - -inline void DynamicAutomationProperties::SetAccessibilityStateUnchecked(Windows::UI::Xaml::UIElement const& element, bool value) -{ - impl::call_factory([&](auto&& f) { return f.SetAccessibilityStateUnchecked(element, value); }); -} - -inline bool DynamicAutomationProperties::GetAccessibilityStateUnchecked(Windows::UI::Xaml::UIElement const& element) -{ - return impl::call_factory([&](auto&& f) { return f.GetAccessibilityStateUnchecked(element); }); -} - -inline Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityStateBusyProperty() -{ - return impl::call_factory([&](auto&& f) { return f.AccessibilityStateBusyProperty(); }); -} - -inline void DynamicAutomationProperties::SetAccessibilityStateBusy(Windows::UI::Xaml::UIElement const& element, bool value) -{ - impl::call_factory([&](auto&& f) { return f.SetAccessibilityStateBusy(element, value); }); -} - -inline bool DynamicAutomationProperties::GetAccessibilityStateBusy(Windows::UI::Xaml::UIElement const& element) -{ - return impl::call_factory([&](auto&& f) { return f.GetAccessibilityStateBusy(element); }); -} - -inline Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityStateExpandedProperty() -{ - return impl::call_factory([&](auto&& f) { return f.AccessibilityStateExpandedProperty(); }); -} - -inline void DynamicAutomationProperties::SetAccessibilityStateExpanded(Windows::UI::Xaml::UIElement const& element, bool value) -{ - impl::call_factory([&](auto&& f) { return f.SetAccessibilityStateExpanded(element, value); }); -} - -inline bool DynamicAutomationProperties::GetAccessibilityStateExpanded(Windows::UI::Xaml::UIElement const& element) -{ - return impl::call_factory([&](auto&& f) { return f.GetAccessibilityStateExpanded(element); }); -} - -inline Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityStateCollapsedProperty() -{ - return impl::call_factory([&](auto&& f) { return f.AccessibilityStateCollapsedProperty(); }); -} - -inline void DynamicAutomationProperties::SetAccessibilityStateCollapsed(Windows::UI::Xaml::UIElement const& element, bool value) -{ - impl::call_factory([&](auto&& f) { return f.SetAccessibilityStateCollapsed(element, value); }); -} - -inline bool DynamicAutomationProperties::GetAccessibilityStateCollapsed(Windows::UI::Xaml::UIElement const& element) -{ - return impl::call_factory([&](auto&& f) { return f.GetAccessibilityStateCollapsed(element); }); -} - -inline Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityInvokeEventHandlerProperty() -{ - return impl::call_factory([&](auto&& f) { return f.AccessibilityInvokeEventHandlerProperty(); }); -} - -inline void DynamicAutomationProperties::SetAccessibilityInvokeEventHandler(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityInvokeEventHandler const& value) -{ - impl::call_factory([&](auto&& f) { return f.SetAccessibilityInvokeEventHandler(element, value); }); -} - -inline react::uwp::AccessibilityInvokeEventHandler DynamicAutomationProperties::GetAccessibilityInvokeEventHandler(Windows::UI::Xaml::UIElement const& element) -{ - return impl::call_factory([&](auto&& f) { return f.GetAccessibilityInvokeEventHandler(element); }); -} - -inline Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityActionsProperty() -{ - return impl::call_factory([&](auto&& f) { return f.AccessibilityActionsProperty(); }); -} - -inline void DynamicAutomationProperties::SetAccessibilityActions(Windows::UI::Xaml::UIElement const& element, param::vector const& value) -{ - impl::call_factory([&](auto&& f) { return f.SetAccessibilityActions(element, value); }); -} - -inline Windows::Foundation::Collections::IVector DynamicAutomationProperties::GetAccessibilityActions(Windows::UI::Xaml::UIElement const& element) -{ - return impl::call_factory([&](auto&& f) { return f.GetAccessibilityActions(element); }); -} - -inline Windows::UI::Xaml::DependencyProperty DynamicAutomationProperties::AccessibilityActionEventHandlerProperty() -{ - return impl::call_factory([&](auto&& f) { return f.AccessibilityActionEventHandlerProperty(); }); -} - -inline void DynamicAutomationProperties::SetAccessibilityActionEventHandler(Windows::UI::Xaml::UIElement const& element, react::uwp::AccessibilityActionEventHandler const& value) -{ - impl::call_factory([&](auto&& f) { return f.SetAccessibilityActionEventHandler(element, value); }); -} - -inline react::uwp::AccessibilityActionEventHandler DynamicAutomationProperties::GetAccessibilityActionEventHandler(Windows::UI::Xaml::UIElement const& element) -{ - return impl::call_factory([&](auto&& f) { return f.GetAccessibilityActionEventHandler(element); }); -} - -inline ViewControl::ViewControl() : - ViewControl(impl::call_factory([](auto&& f) { return f.template ActivateInstance(); })) -{} - -inline ViewPanel::ViewPanel() : - ViewPanel(impl::call_factory([](auto&& f) { return f.template ActivateInstance(); })) -{} - -inline Windows::UI::Xaml::DependencyProperty ViewPanel::ViewBackgroundProperty() -{ - return impl::call_factory([&](auto&& f) { return f.ViewBackgroundProperty(); }); -} - -inline Windows::UI::Xaml::DependencyProperty ViewPanel::BorderThicknessProperty() -{ - return impl::call_factory([&](auto&& f) { return f.BorderThicknessProperty(); }); -} - -inline Windows::UI::Xaml::DependencyProperty ViewPanel::BorderBrushProperty() -{ - return impl::call_factory([&](auto&& f) { return f.BorderBrushProperty(); }); -} - -inline Windows::UI::Xaml::DependencyProperty ViewPanel::CornerRadiusProperty() -{ - return impl::call_factory([&](auto&& f) { return f.CornerRadiusProperty(); }); -} - -inline Windows::UI::Xaml::DependencyProperty ViewPanel::ClipChildrenProperty() -{ - return impl::call_factory([&](auto&& f) { return f.ClipChildrenProperty(); }); -} - -inline Windows::UI::Xaml::DependencyProperty ViewPanel::TopProperty() -{ - return impl::call_factory([&](auto&& f) { return f.TopProperty(); }); -} - -inline void ViewPanel::SetTop(Windows::UI::Xaml::UIElement const& element, double value) -{ - impl::call_factory([&](auto&& f) { return f.SetTop(element, value); }); -} - -inline double ViewPanel::GetTop(Windows::UI::Xaml::UIElement const& element) -{ - return impl::call_factory([&](auto&& f) { return f.GetTop(element); }); -} - -inline Windows::UI::Xaml::DependencyProperty ViewPanel::LeftProperty() -{ - return impl::call_factory([&](auto&& f) { return f.LeftProperty(); }); -} - -inline void ViewPanel::SetLeft(Windows::UI::Xaml::UIElement const& element, double value) -{ - impl::call_factory([&](auto&& f) { return f.SetLeft(element, value); }); -} - -inline double ViewPanel::GetLeft(Windows::UI::Xaml::UIElement const& element) -{ - return impl::call_factory([&](auto&& f) { return f.GetLeft(element); }); -} - -template AccessibilityActionEventHandler::AccessibilityActionEventHandler(L handler) : - AccessibilityActionEventHandler(impl::make_delegate(std::forward(handler))) -{} - -template AccessibilityActionEventHandler::AccessibilityActionEventHandler(F* handler) : - AccessibilityActionEventHandler([=](auto&&... args) { return handler(args...); }) -{} - -template AccessibilityActionEventHandler::AccessibilityActionEventHandler(O* object, M method) : - AccessibilityActionEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) -{} - -template AccessibilityActionEventHandler::AccessibilityActionEventHandler(com_ptr&& object, M method) : - AccessibilityActionEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) -{} - -template AccessibilityActionEventHandler::AccessibilityActionEventHandler(weak_ref&& object, M method) : - AccessibilityActionEventHandler([o = std::move(object), method](auto&&... args) { if (auto s = o.get()) { ((*s).*(method))(args...); } }) -{} - -inline void AccessibilityActionEventHandler::operator()(react::uwp::AccessibilityAction const& action) const -{ - check_hresult((*(impl::abi_t**)this)->Invoke(get_abi(action))); -} - -template AccessibilityInvokeEventHandler::AccessibilityInvokeEventHandler(L handler) : - AccessibilityInvokeEventHandler(impl::make_delegate(std::forward(handler))) -{} - -template AccessibilityInvokeEventHandler::AccessibilityInvokeEventHandler(F* handler) : - AccessibilityInvokeEventHandler([=](auto&&... args) { return handler(args...); }) -{} - -template AccessibilityInvokeEventHandler::AccessibilityInvokeEventHandler(O* object, M method) : - AccessibilityInvokeEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) -{} - -template AccessibilityInvokeEventHandler::AccessibilityInvokeEventHandler(com_ptr&& object, M method) : - AccessibilityInvokeEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) -{} - -template AccessibilityInvokeEventHandler::AccessibilityInvokeEventHandler(weak_ref&& object, M method) : - AccessibilityInvokeEventHandler([o = std::move(object), method](auto&&... args) { if (auto s = o.get()) { ((*s).*(method))(args...); } }) -{} - -inline void AccessibilityInvokeEventHandler::operator()() const -{ - check_hresult((*(impl::abi_t**)this)->Invoke()); -} - -} - -namespace winrt::impl { - -struct property_react_uwp_IDynamicAutomationPropertiesStatics -{ struct named { - struct AccessibilityActionEventHandlerProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityActionEventHandlerProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IDynamicAutomationPropertiesStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.AccessibilityActionEventHandlerProperty(); - } - }; - }; - struct AccessibilityActionsProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityActionsProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IDynamicAutomationPropertiesStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.AccessibilityActionsProperty(); - } - }; - }; - struct AccessibilityInvokeEventHandlerProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityInvokeEventHandlerProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IDynamicAutomationPropertiesStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.AccessibilityInvokeEventHandlerProperty(); - } - }; - }; - struct AccessibilityRoleProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityRoleProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IDynamicAutomationPropertiesStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.AccessibilityRoleProperty(); - } - }; - }; - struct AccessibilityStateBusyProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateBusyProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IDynamicAutomationPropertiesStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.AccessibilityStateBusyProperty(); - } - }; - }; - struct AccessibilityStateCheckedProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateCheckedProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IDynamicAutomationPropertiesStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.AccessibilityStateCheckedProperty(); - } - }; - }; - struct AccessibilityStateCollapsedProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateCollapsedProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IDynamicAutomationPropertiesStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.AccessibilityStateCollapsedProperty(); - } - }; - }; - struct AccessibilityStateDisabledProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateDisabledProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IDynamicAutomationPropertiesStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.AccessibilityStateDisabledProperty(); - } - }; - }; - struct AccessibilityStateExpandedProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateExpandedProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IDynamicAutomationPropertiesStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.AccessibilityStateExpandedProperty(); - } - }; - }; - struct AccessibilityStateSelectedProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateSelectedProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IDynamicAutomationPropertiesStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.AccessibilityStateSelectedProperty(); - } - }; - }; - struct AccessibilityStateUncheckedProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateUncheckedProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IDynamicAutomationPropertiesStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.AccessibilityStateUncheckedProperty(); - } - }; - };}; - struct list { using type = impl::typelist; }; -}; - -struct property_react_uwp_IViewPanel -{ struct named { - struct BorderBrush - { - struct name { static constexpr std::wstring_view value{ L"BorderBrush"sv }; }; - using property_type = winrt::Windows::UI::Xaml::Media::Brush; - using target_type = winrt::react::uwp::IViewPanel; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.BorderBrush(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.BorderBrush(std::forward(value)); - } - }; - }; - struct BorderThickness - { - struct name { static constexpr std::wstring_view value{ L"BorderThickness"sv }; }; - using property_type = winrt::Windows::UI::Xaml::Thickness; - using target_type = winrt::react::uwp::IViewPanel; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.BorderThickness(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.BorderThickness(std::forward(value)); - } - }; - }; - struct ClipChildren - { - struct name { static constexpr std::wstring_view value{ L"ClipChildren"sv }; }; - using property_type = bool; - using target_type = winrt::react::uwp::IViewPanel; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.ClipChildren(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.ClipChildren(std::forward(value)); - } - }; - }; - struct CornerRadius - { - struct name { static constexpr std::wstring_view value{ L"CornerRadius"sv }; }; - using property_type = winrt::Windows::UI::Xaml::CornerRadius; - using target_type = winrt::react::uwp::IViewPanel; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.CornerRadius(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.CornerRadius(std::forward(value)); - } - }; - }; - struct ViewBackground - { - struct name { static constexpr std::wstring_view value{ L"ViewBackground"sv }; }; - using property_type = winrt::Windows::UI::Xaml::Media::Brush; - using target_type = winrt::react::uwp::IViewPanel; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.ViewBackground(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.ViewBackground(std::forward(value)); - } - }; - };}; - struct list { using type = impl::typelist; }; -}; - -struct property_react_uwp_IViewPanelStatics -{ struct named { - struct BorderBrushProperty - { - struct name { static constexpr std::wstring_view value{ L"BorderBrushProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IViewPanelStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.BorderBrushProperty(); - } - }; - }; - struct BorderThicknessProperty - { - struct name { static constexpr std::wstring_view value{ L"BorderThicknessProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IViewPanelStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.BorderThicknessProperty(); - } - }; - }; - struct ClipChildrenProperty - { - struct name { static constexpr std::wstring_view value{ L"ClipChildrenProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IViewPanelStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.ClipChildrenProperty(); - } - }; - }; - struct CornerRadiusProperty - { - struct name { static constexpr std::wstring_view value{ L"CornerRadiusProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IViewPanelStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.CornerRadiusProperty(); - } - }; - }; - struct LeftProperty - { - struct name { static constexpr std::wstring_view value{ L"LeftProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IViewPanelStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.LeftProperty(); - } - }; - }; - struct TopProperty - { - struct name { static constexpr std::wstring_view value{ L"TopProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IViewPanelStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.TopProperty(); - } - }; - }; - struct ViewBackgroundProperty - { - struct name { static constexpr std::wstring_view value{ L"ViewBackgroundProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::IViewPanelStatics; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.ViewBackgroundProperty(); - } - }; - };}; - struct list { using type = impl::typelist; }; -}; - -struct property_react_uwp_DynamicAutomationPeer -{ struct named { - struct ExpandCollapseState - { - struct name { static constexpr std::wstring_view value{ L"ExpandCollapseState"sv }; }; - using property_type = winrt::Windows::UI::Xaml::Automation::ExpandCollapseState; - using target_type = winrt::react::uwp::DynamicAutomationPeer; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.ExpandCollapseState(); - } - }; - }; - struct IsSelected - { - struct name { static constexpr std::wstring_view value{ L"IsSelected"sv }; }; - using property_type = bool; - using target_type = winrt::react::uwp::DynamicAutomationPeer; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.IsSelected(); - } - }; - }; - struct SelectionContainer - { - struct name { static constexpr std::wstring_view value{ L"SelectionContainer"sv }; }; - using property_type = winrt::Windows::UI::Xaml::Automation::Provider::IRawElementProviderSimple; - using target_type = winrt::react::uwp::DynamicAutomationPeer; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.SelectionContainer(); - } - }; - }; - struct CanSelectMultiple - { - struct name { static constexpr std::wstring_view value{ L"CanSelectMultiple"sv }; }; - using property_type = bool; - using target_type = winrt::react::uwp::DynamicAutomationPeer; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.CanSelectMultiple(); - } - }; - }; - struct IsSelectionRequired - { - struct name { static constexpr std::wstring_view value{ L"IsSelectionRequired"sv }; }; - using property_type = bool; - using target_type = winrt::react::uwp::DynamicAutomationPeer; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.IsSelectionRequired(); - } - }; - }; - struct ToggleState - { - struct name { static constexpr std::wstring_view value{ L"ToggleState"sv }; }; - using property_type = winrt::Windows::UI::Xaml::Automation::ToggleState; - using target_type = winrt::react::uwp::DynamicAutomationPeer; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.ToggleState(); - } - }; - };}; - struct list { using type = impl::typelist; }; -}; - -struct property_react_uwp_DynamicAutomationProperties -{ struct named { - struct AccessibilityActionEventHandlerProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityActionEventHandlerProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::DynamicAutomationProperties; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::AccessibilityActionEventHandlerProperty(); - } - }; - }; - struct AccessibilityActionsProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityActionsProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::DynamicAutomationProperties; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::AccessibilityActionsProperty(); - } - }; - }; - struct AccessibilityInvokeEventHandlerProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityInvokeEventHandlerProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::DynamicAutomationProperties; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::AccessibilityInvokeEventHandlerProperty(); - } - }; - }; - struct AccessibilityRoleProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityRoleProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::DynamicAutomationProperties; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::AccessibilityRoleProperty(); - } - }; - }; - struct AccessibilityStateBusyProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateBusyProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::DynamicAutomationProperties; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::AccessibilityStateBusyProperty(); - } - }; - }; - struct AccessibilityStateCheckedProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateCheckedProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::DynamicAutomationProperties; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::AccessibilityStateCheckedProperty(); - } - }; - }; - struct AccessibilityStateCollapsedProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateCollapsedProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::DynamicAutomationProperties; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::AccessibilityStateCollapsedProperty(); - } - }; - }; - struct AccessibilityStateDisabledProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateDisabledProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::DynamicAutomationProperties; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::AccessibilityStateDisabledProperty(); - } - }; - }; - struct AccessibilityStateExpandedProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateExpandedProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::DynamicAutomationProperties; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::AccessibilityStateExpandedProperty(); - } - }; - }; - struct AccessibilityStateSelectedProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateSelectedProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::DynamicAutomationProperties; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::AccessibilityStateSelectedProperty(); - } - }; - }; - struct AccessibilityStateUncheckedProperty - { - struct name { static constexpr std::wstring_view value{ L"AccessibilityStateUncheckedProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::DynamicAutomationProperties; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::AccessibilityStateUncheckedProperty(); - } - }; - };}; - struct list { using type = impl::typelist; }; -}; - -struct property_react_uwp_ViewPanel -{ struct named { - struct ViewBackground - { - struct name { static constexpr std::wstring_view value{ L"ViewBackground"sv }; }; - using property_type = winrt::Windows::UI::Xaml::Media::Brush; - using target_type = winrt::react::uwp::ViewPanel; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.ViewBackground(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.ViewBackground(std::forward(value)); - } - }; - }; - struct CornerRadius - { - struct name { static constexpr std::wstring_view value{ L"CornerRadius"sv }; }; - using property_type = winrt::Windows::UI::Xaml::CornerRadius; - using target_type = winrt::react::uwp::ViewPanel; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.CornerRadius(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.CornerRadius(std::forward(value)); - } - }; - }; - struct ClipChildren - { - struct name { static constexpr std::wstring_view value{ L"ClipChildren"sv }; }; - using property_type = bool; - using target_type = winrt::react::uwp::ViewPanel; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.ClipChildren(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.ClipChildren(std::forward(value)); - } - }; - }; - struct BorderThickness - { - struct name { static constexpr std::wstring_view value{ L"BorderThickness"sv }; }; - using property_type = winrt::Windows::UI::Xaml::Thickness; - using target_type = winrt::react::uwp::ViewPanel; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.BorderThickness(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.BorderThickness(std::forward(value)); - } - }; - }; - struct BorderBrush - { - struct name { static constexpr std::wstring_view value{ L"BorderBrush"sv }; }; - using property_type = winrt::Windows::UI::Xaml::Media::Brush; - using target_type = winrt::react::uwp::ViewPanel; - - using is_readable = std::true_type; - using is_writable = std::true_type; - using is_static = std::false_type; - struct getter - { - auto operator()(target_type const& target) const - { - return target.BorderBrush(); - } - }; - struct setter - { - template - void operator()(target_type const& target, Value&& value) const - { - target.BorderBrush(std::forward(value)); - } - }; - }; - struct BorderBrushProperty - { - struct name { static constexpr std::wstring_view value{ L"BorderBrushProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::ViewPanel; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::BorderBrushProperty(); - } - }; - }; - struct BorderThicknessProperty - { - struct name { static constexpr std::wstring_view value{ L"BorderThicknessProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::ViewPanel; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::BorderThicknessProperty(); - } - }; - }; - struct ClipChildrenProperty - { - struct name { static constexpr std::wstring_view value{ L"ClipChildrenProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::ViewPanel; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::ClipChildrenProperty(); - } - }; - }; - struct CornerRadiusProperty - { - struct name { static constexpr std::wstring_view value{ L"CornerRadiusProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::ViewPanel; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::CornerRadiusProperty(); - } - }; - }; - struct LeftProperty - { - struct name { static constexpr std::wstring_view value{ L"LeftProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::ViewPanel; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::LeftProperty(); - } - }; - }; - struct TopProperty - { - struct name { static constexpr std::wstring_view value{ L"TopProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::ViewPanel; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::TopProperty(); - } - }; - }; - struct ViewBackgroundProperty - { - struct name { static constexpr std::wstring_view value{ L"ViewBackgroundProperty"sv }; }; - using property_type = winrt::Windows::UI::Xaml::DependencyProperty; - using target_type = winrt::react::uwp::ViewPanel; - - using is_readable = std::true_type; - using is_writable = std::false_type; - using is_static = std::true_type; - struct getter - { - auto operator()() const - { - return target_type::ViewBackgroundProperty(); - } - }; - };}; - struct list { using type = impl::typelist; }; -}; - -} - -WINRT_EXPORT namespace winrt::experimental::reflect { -template <> struct named_property : impl::property_react_uwp_IDynamicAutomationPropertiesStatics::named {}; -template <> struct properties : impl::property_react_uwp_IDynamicAutomationPropertiesStatics::list {}; -template <> struct named_property : impl::property_react_uwp_IViewPanel::named {}; -template <> struct properties : impl::property_react_uwp_IViewPanel::list {}; -template <> struct named_property : impl::property_react_uwp_IViewPanelStatics::named {}; -template <> struct properties : impl::property_react_uwp_IViewPanelStatics::list {}; -template <> struct named_property : impl::property_react_uwp_DynamicAutomationPeer::named {}; -template <> struct properties : impl::property_react_uwp_DynamicAutomationPeer::list {}; -template <> struct named_property : impl::property_react_uwp_DynamicAutomationProperties::named {}; -template <> struct properties : impl::property_react_uwp_DynamicAutomationProperties::list {}; -template <> struct named_property : impl::property_react_uwp_ViewPanel::named {}; -template <> struct properties : impl::property_react_uwp_ViewPanel::list {}; - -template <> -struct base_type { using type = Windows::UI::Xaml::Automation::Peers::FrameworkElementAutomationPeer; }; -template <> -struct base_type { using type = Windows::UI::Xaml::Controls::ContentControl; }; -template <> -struct base_type { using type = Windows::UI::Xaml::Controls::Panel; };template <> struct get_enumerator_names -{ - static constexpr std::array value{{ - {L"None", 4}, - {L"Button", 6}, - {L"Link", 4}, - {L"Search", 6}, - {L"Image", 5}, - {L"KeyboardKey", 11}, - {L"Text", 4}, - {L"Adjustable", 10}, - {L"ImageButton", 11}, - {L"Header", 6}, - {L"Summary", 7}, - {L"Alert", 5}, - {L"CheckBox", 8}, - {L"ComboBox", 8}, - {L"Menu", 4}, - {L"MenuBar", 7}, - {L"MenuItem", 8}, - {L"ProgressBar", 11}, - {L"Radio", 5}, - {L"RadioGroup", 10}, - {L"ScrollBar", 9}, - {L"SpinButton", 10}, - {L"Switch", 6}, - {L"Tab", 3}, - {L"TabList", 7}, - {L"Timer", 5}, - {L"ToolBar", 7}, - {L"List", 4}, - {L"ListItem", 8}, - {L"Unknown", 7}, - {L"CountRoles", 10}, }}; -}; -template <> struct get_enumerator_values -{ - static constexpr std::array value{{ - react::uwp::AccessibilityRoles::None, - react::uwp::AccessibilityRoles::Button, - react::uwp::AccessibilityRoles::Link, - react::uwp::AccessibilityRoles::Search, - react::uwp::AccessibilityRoles::Image, - react::uwp::AccessibilityRoles::KeyboardKey, - react::uwp::AccessibilityRoles::Text, - react::uwp::AccessibilityRoles::Adjustable, - react::uwp::AccessibilityRoles::ImageButton, - react::uwp::AccessibilityRoles::Header, - react::uwp::AccessibilityRoles::Summary, - react::uwp::AccessibilityRoles::Alert, - react::uwp::AccessibilityRoles::CheckBox, - react::uwp::AccessibilityRoles::ComboBox, - react::uwp::AccessibilityRoles::Menu, - react::uwp::AccessibilityRoles::MenuBar, - react::uwp::AccessibilityRoles::MenuItem, - react::uwp::AccessibilityRoles::ProgressBar, - react::uwp::AccessibilityRoles::Radio, - react::uwp::AccessibilityRoles::RadioGroup, - react::uwp::AccessibilityRoles::ScrollBar, - react::uwp::AccessibilityRoles::SpinButton, - react::uwp::AccessibilityRoles::Switch, - react::uwp::AccessibilityRoles::Tab, - react::uwp::AccessibilityRoles::TabList, - react::uwp::AccessibilityRoles::Timer, - react::uwp::AccessibilityRoles::ToolBar, - react::uwp::AccessibilityRoles::List, - react::uwp::AccessibilityRoles::ListItem, - react::uwp::AccessibilityRoles::Unknown, - react::uwp::AccessibilityRoles::CountRoles, }}; -}; -template <> struct get_enumerator_names -{ - static constexpr std::array value{{ - {L"Selected", 8}, - {L"Disabled", 8}, - {L"Checked", 7}, - {L"Unchecked", 9}, - {L"Busy", 4}, - {L"Expanded", 8}, - {L"Collapsed", 9}, - {L"CountStates", 11}, }}; -}; -template <> struct get_enumerator_values -{ - static constexpr std::array value{{ - react::uwp::AccessibilityStates::Selected, - react::uwp::AccessibilityStates::Disabled, - react::uwp::AccessibilityStates::Checked, - react::uwp::AccessibilityStates::Unchecked, - react::uwp::AccessibilityStates::Busy, - react::uwp::AccessibilityStates::Expanded, - react::uwp::AccessibilityStates::Collapsed, - react::uwp::AccessibilityStates::CountStates, }}; -}; - -} - -WINRT_EXPORT namespace std { - -template<> struct hash : winrt::impl::hash_base {}; -template<> struct hash : winrt::impl::hash_base {}; -template<> struct hash : winrt::impl::hash_base {}; -template<> struct hash : winrt::impl::hash_base {}; -template<> struct hash : winrt::impl::hash_base {}; -template<> struct hash : winrt::impl::hash_base {}; -template<> struct hash : winrt::impl::hash_base {}; -template<> struct hash : winrt::impl::hash_base {}; -template<> struct hash : winrt::impl::hash_base {}; -template<> struct hash : winrt::impl::hash_base {}; -template<> struct hash : winrt::impl::hash_base {}; - -} diff --git a/vnext/ReactUWP/packages.config b/vnext/ReactUWP/packages.config index cdb7bb377d4..0b218a1f8d6 100644 --- a/vnext/ReactUWP/packages.config +++ b/vnext/ReactUWP/packages.config @@ -1,4 +1,7 @@  + + + \ No newline at end of file diff --git a/vnext/Universal.UnitTests/React.Windows.Universal.UnitTests.vcxproj b/vnext/Universal.UnitTests/React.Windows.Universal.UnitTests.vcxproj index d4a343ab891..c5c6e20a26b 100644 --- a/vnext/Universal.UnitTests/React.Windows.Universal.UnitTests.vcxproj +++ b/vnext/Universal.UnitTests/React.Windows.Universal.UnitTests.vcxproj @@ -63,7 +63,7 @@ false - + @@ -109,7 +109,6 @@ - diff --git a/vnext/Universal.UnitTests/React.Windows.Universal.UnitTests.vcxproj.filters b/vnext/Universal.UnitTests/React.Windows.Universal.UnitTests.vcxproj.filters index fb5dbedbce7..dceca4d4bac 100644 --- a/vnext/Universal.UnitTests/React.Windows.Universal.UnitTests.vcxproj.filters +++ b/vnext/Universal.UnitTests/React.Windows.Universal.UnitTests.vcxproj.filters @@ -16,9 +16,6 @@ - - Tests - Tests From cd5b3785185d61335b75a65547c9f4273913d037 Mon Sep 17 00:00:00 2001 From: React-Native-Windows Bot <53619745+rnbot@users.noreply.github.com> Date: Wed, 6 Nov 2019 23:32:18 +0000 Subject: [PATCH 08/29] applying package updates ***NO_CI*** --- ...tive-windows-2019-11-05-11-50-13-cppwinrt4.json | 8 -------- vnext/CHANGELOG.json | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) delete mode 100644 change/react-native-windows-2019-11-05-11-50-13-cppwinrt4.json diff --git a/change/react-native-windows-2019-11-05-11-50-13-cppwinrt4.json b/change/react-native-windows-2019-11-05-11-50-13-cppwinrt4.json deleted file mode 100644 index 23de98c0316..00000000000 --- a/change/react-native-windows-2019-11-05-11-50-13-cppwinrt4.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "none", - "comment": "use Microsoft.Windows.CppWinRT", - "packageName": "react-native-windows", - "email": "licanhua@live.com", - "commit": "1a49fbedd193735f47b6b6ad8359c901bd91a2bd", - "date": "2019-11-05T19:50:13.804Z" -} \ No newline at end of file diff --git a/vnext/CHANGELOG.json b/vnext/CHANGELOG.json index b64f1807b52..b73e06a8ef4 100644 --- a/vnext/CHANGELOG.json +++ b/vnext/CHANGELOG.json @@ -1,6 +1,20 @@ { "name": "react-native-windows", "entries": [ + { + "date": "Wed, 06 Nov 2019 23:32:18 GMT", + "tag": "react-native-windows_v0.60.0-vnext.65", + "version": "0.60.0-vnext.65", + "comments": { + "none": [ + { + "comment": "use Microsoft.Windows.CppWinRT", + "author": "licanhua@live.com", + "commit": "1a49fbedd193735f47b6b6ad8359c901bd91a2bd" + } + ] + } + }, { "date": "Wed, 06 Nov 2019 13:58:14 GMT", "tag": "react-native-windows_v0.60.0-vnext.65", From adb85c77a775b63ea0c195eaa7f45d8cf2d6b497 Mon Sep 17 00:00:00 2001 From: Di Da Date: Thu, 7 Nov 2019 09:33:14 -0800 Subject: [PATCH 09/29] Add support for scrollView.refreshControl (#3597) * Support refreshControl --- ...-windows-2019-11-05-11-31-02-refresh2.json | 8 + .../Samples/scrollViewSnapSample.tsx | 19 + .../windows/playground/HostingPane.xaml | 2 - .../windows/playground/HostingPane.xaml.cpp | 7 + vnext/ReactUWP/Base/UwpReactInstance.cpp | 2 + vnext/ReactUWP/ReactUWP.vcxproj | 2 + vnext/ReactUWP/ReactUWP.vcxproj.filters | 8 +- vnext/ReactUWP/Utils/Helpers.cpp | 22 + vnext/ReactUWP/Utils/Helpers.h | 2 + .../ReactUWP/Views/RefreshControlManager.cpp | 120 ++ vnext/ReactUWP/Views/RefreshControlManager.h | 29 + .../RefreshControl/RefreshControl.windows.js | 216 +++ .../ScrollView/ScrollView.windows.js | 1278 +++++++++++++++++ 13 files changed, 1711 insertions(+), 4 deletions(-) create mode 100644 change/react-native-windows-2019-11-05-11-31-02-refresh2.json create mode 100644 vnext/ReactUWP/Views/RefreshControlManager.cpp create mode 100644 vnext/ReactUWP/Views/RefreshControlManager.h create mode 100644 vnext/src/Libraries/Components/RefreshControl/RefreshControl.windows.js create mode 100644 vnext/src/Libraries/Components/ScrollView/ScrollView.windows.js diff --git a/change/react-native-windows-2019-11-05-11-31-02-refresh2.json b/change/react-native-windows-2019-11-05-11-31-02-refresh2.json new file mode 100644 index 00000000000..f585c26cdd1 --- /dev/null +++ b/change/react-native-windows-2019-11-05-11-31-02-refresh2.json @@ -0,0 +1,8 @@ +{ + "type": "prerelease", + "comment": "Support refreshControl", + "packageName": "react-native-windows", + "email": "dida@ntdev.microsoft.com", + "commit": "7f7144f6708042a8e4983a143ef2733ac81abea5", + "date": "2019-11-05T19:31:02.270Z" +} \ No newline at end of file diff --git a/packages/playground/Samples/scrollViewSnapSample.tsx b/packages/playground/Samples/scrollViewSnapSample.tsx index 3ad5b32790b..5e814d91f72 100644 --- a/packages/playground/Samples/scrollViewSnapSample.tsx +++ b/packages/playground/Samples/scrollViewSnapSample.tsx @@ -13,8 +13,15 @@ import { Text, ScrollView, TouchableOpacity, + RefreshControl, } from 'react-native'; +function wait(timeout: number) { + return new Promise(resolve => { + setTimeout(resolve, timeout); + }); +} + export default class Bootstrap extends React.Component<{}, any> { state = { horizontalValue: true, @@ -22,6 +29,7 @@ export default class Bootstrap extends React.Component<{}, any> { snapToEndValue: false, zoomValue: false, alignToStartValue: true, + refreshing: false, }; toggleSwitch1 = (value: boolean) => { @@ -44,6 +52,11 @@ export default class Bootstrap extends React.Component<{}, any> { this.setState({alignToStartValue: value}); }; + onRefresh = () => { + this.setState({refreshing: true}); + wait(2000).then(() => this.setState({refreshing: false})); + }; + makeItems = (nItems: number, styles: Object): Array => { const items = []; for (let i = 0; i < nItems; i++) { @@ -153,6 +166,12 @@ export default class Bootstrap extends React.Component<{}, any> { ? styles.horizontalScrollViewStyle : styles.verticalScrollViewStyle } + refreshControl={ + + } snapToOffsets={[100.0, 500.0]} minimumZoomScale={0.1} maximumZoomScale={2.0} diff --git a/packages/playground/windows/playground/HostingPane.xaml b/packages/playground/windows/playground/HostingPane.xaml index 42d34bf2d78..f2c67473c08 100644 --- a/packages/playground/windows/playground/HostingPane.xaml +++ b/packages/playground/windows/playground/HostingPane.xaml @@ -33,7 +33,6 @@ (); x_ReactAppName->ItemsSource = m_ReactAppNames; + + // IsEditable is only supported on RS4 or higher + if (Windows::Foundation::Metadata::ApiInformation::IsApiContractPresent( + L"Windows.Foundation.UniversalApiContract", 6)) { + x_ReactAppName->IsEditable = true; + x_JavaScriptFilename->IsEditable = true; + } } void HostingPane::LoadKnownApps() { diff --git a/vnext/ReactUWP/Base/UwpReactInstance.cpp b/vnext/ReactUWP/Base/UwpReactInstance.cpp index 1e75604e25c..e5ef6bffdb3 100644 --- a/vnext/ReactUWP/Base/UwpReactInstance.cpp +++ b/vnext/ReactUWP/Base/UwpReactInstance.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -132,6 +133,7 @@ CreateUIManager( viewManagers.push_back(std::make_unique(instance)); viewManagers.push_back(std::make_unique(instance)); viewManagers.push_back(std::make_unique(instance)); + viewManagers.push_back(std::make_unique(instance)); // Polyester view managers viewManagers.push_back(std::make_unique(instance)); diff --git a/vnext/ReactUWP/ReactUWP.vcxproj b/vnext/ReactUWP/ReactUWP.vcxproj index f2fe54ede31..3c72b14fb96 100644 --- a/vnext/ReactUWP/ReactUWP.vcxproj +++ b/vnext/ReactUWP/ReactUWP.vcxproj @@ -239,6 +239,7 @@ + @@ -341,6 +342,7 @@ + diff --git a/vnext/ReactUWP/ReactUWP.vcxproj.filters b/vnext/ReactUWP/ReactUWP.vcxproj.filters index 96ae185f1dd..c61bf47d0a4 100644 --- a/vnext/ReactUWP/ReactUWP.vcxproj.filters +++ b/vnext/ReactUWP/ReactUWP.vcxproj.filters @@ -302,7 +302,9 @@ Views - + + Views + @@ -618,7 +620,9 @@ Modules - + + Views + diff --git a/vnext/ReactUWP/Utils/Helpers.cpp b/vnext/ReactUWP/Utils/Helpers.cpp index 6ddd46f4084..c6919e0b697 100644 --- a/vnext/ReactUWP/Utils/Helpers.cpp +++ b/vnext/ReactUWP/Utils/Helpers.cpp @@ -4,11 +4,13 @@ #include "pch.h" #include +#include #include "Helpers.h" namespace winrt { using namespace Windows::UI::Xaml::Controls::Primitives; using namespace Windows::UI::Xaml::Media; +using namespace Windows::Foundation::Metadata; } // namespace winrt namespace react { @@ -43,5 +45,25 @@ std::int32_t CountOpenPopups() { return (int32_t)popups.Size(); } +template +bool IsAPIContractVxAvailable() { + static bool isAPIContractVxAvailableInitialized = false; + static bool isAPIContractVxAvailable = false; + if (!isAPIContractVxAvailableInitialized) { + isAPIContractVxAvailableInitialized = true; + isAPIContractVxAvailable = + winrt::ApiInformation::IsApiContractPresent(L"Windows.Foundation.UniversalApiContract", APIVersion); + } + + return isAPIContractVxAvailable; +} + +bool IsAPIContractV6Available() { + return IsAPIContractVxAvailable<6>(); +} + +bool IsRS4OrHigher() { + return IsAPIContractV6Available(); +} } // namespace uwp }; // namespace react diff --git a/vnext/ReactUWP/Utils/Helpers.h b/vnext/ReactUWP/Utils/Helpers.h index 66b62c6c607..50c46a234b3 100644 --- a/vnext/ReactUWP/Utils/Helpers.h +++ b/vnext/ReactUWP/Utils/Helpers.h @@ -29,5 +29,7 @@ inline typename T asEnum(folly::dynamic const &obj) { ReactId getViewId(_In_ IReactInstance *instance, winrt::FrameworkElement const &fe); std::int32_t CountOpenPopups(); + +bool IsRS4OrHigher(); } // namespace uwp } // namespace react diff --git a/vnext/ReactUWP/Views/RefreshControlManager.cpp b/vnext/ReactUWP/Views/RefreshControlManager.cpp new file mode 100644 index 00000000000..d72248abecd --- /dev/null +++ b/vnext/ReactUWP/Views/RefreshControlManager.cpp @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#include "pch.h" + +#include "RefreshControlManager.h" + +#include + +#include +#include + +namespace winrt { +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::Foundation; +} // namespace winrt + +namespace react { +namespace uwp { + +class RefreshControlShadowNode : public ShadowNodeBase { + using Super = ShadowNodeBase; + + public: + RefreshControlShadowNode(){}; + void createView() override; + void updateProperties(const folly::dynamic &&props) override; + + private: + winrt::RefreshContainer::RefreshRequested_revoker m_refreshRequestedRevoker{}; + winrt::Deferral m_refreshDeferral{nullptr}; +}; + +void RefreshControlShadowNode::createView() { + Super::createView(); + if (auto refreshContainer = GetView().try_as()) { + m_refreshRequestedRevoker = + refreshContainer.RefreshRequested(winrt::auto_revoke, [this](auto &&, winrt::RefreshRequestedEventArgs args) { + auto wkinstance = GetViewManager()->GetReactInstance(); + if (auto instance = wkinstance.lock()) { + m_refreshDeferral = args.GetDeferral(); + folly::dynamic eventData = folly::dynamic::object(); + instance->DispatchEvent(m_tag, "topOnRefresh", std::move(eventData)); + } + }); + } +} + +void RefreshControlShadowNode::updateProperties(const folly::dynamic &&props) { + if (auto refreshContainer = GetView().try_as()) { + for (const auto &pair : props.items()) { + const std::string &propertyName = pair.first.getString(); + if (propertyName == "flexDirection") { + const folly::dynamic &propertyValue = pair.second; + if (propertyValue.isString() && propertyValue.asString() == "column") { // vertical scrollView + refreshContainer.PullDirection(winrt::RefreshPullDirection::TopToBottom); + } else { + refreshContainer.PullDirection(winrt::RefreshPullDirection::LeftToRight); + } + } else if (propertyName == "refreshing") { + const folly::dynamic &propertyValue = pair.second; + if (propertyValue.isBool()) { + bool refreshing = propertyValue.asBool(); + if (!refreshing && m_refreshDeferral) { + m_refreshDeferral.Complete(); + m_refreshDeferral = nullptr; + } + } + } + } + } + + Super::updateProperties(std::move(props)); +} + +RefreshControlViewManager::RefreshControlViewManager(const std::shared_ptr &reactInstance) + : Super(reactInstance) {} + +facebook::react::ShadowNode *RefreshControlViewManager::createShadow() const { + return new RefreshControlShadowNode(); +} + +const char *RefreshControlViewManager::GetName() const { + return "RCTRefreshControl"; +} + +XamlView RefreshControlViewManager::CreateViewCore(int64_t tag) { + if (IsRS4OrHigher()) { + // refreshContainer is supported >= RS4 + return winrt::RefreshContainer(); + } else { + // just return a grid if refreshContainer is not supported + return winrt::Grid(); + } +} + +void RefreshControlViewManager::AddView(XamlView parent, XamlView child, int64_t index) { + if (auto refreshContainer = parent.try_as()) { + refreshContainer.Content(child.as()); + } else if (auto grid = parent.try_as()) { + grid.Children().Append(child.as()); + } +} + +folly::dynamic RefreshControlViewManager::GetNativeProps() const { + auto props = Super::GetNativeProps(); + + props.update(folly::dynamic::object("refreshing", "boolean")); + + return props; +} + +folly::dynamic RefreshControlViewManager::GetExportedCustomDirectEventTypeConstants() const { + auto directEvents = Super::GetExportedCustomDirectEventTypeConstants(); + directEvents["topOnRefresh"] = folly::dynamic::object("registrationName", "onRefresh"); + return directEvents; +} +} // namespace uwp +} // namespace react diff --git a/vnext/ReactUWP/Views/RefreshControlManager.h b/vnext/ReactUWP/Views/RefreshControlManager.h new file mode 100644 index 00000000000..51f2dd054ce --- /dev/null +++ b/vnext/ReactUWP/Views/RefreshControlManager.h @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#pragma once + +#include + +namespace react { +namespace uwp { + +class RefreshControlViewManager : public FrameworkElementViewManager { + using Super = FrameworkElementViewManager; + + public: + RefreshControlViewManager(const std::shared_ptr &reactInstance); + + facebook::react::ShadowNode *createShadow() const override; + + const char *GetName() const override; + folly::dynamic GetNativeProps() const override; + folly::dynamic GetExportedCustomDirectEventTypeConstants() const override; + + protected: + XamlView CreateViewCore(int64_t tag) override; + void AddView(XamlView parent, XamlView child, int64_t index) override; +}; + +} // namespace uwp +} // namespace react diff --git a/vnext/src/Libraries/Components/RefreshControl/RefreshControl.windows.js b/vnext/src/Libraries/Components/RefreshControl/RefreshControl.windows.js new file mode 100644 index 00000000000..94b5d386dd6 --- /dev/null +++ b/vnext/src/Libraries/Components/RefreshControl/RefreshControl.windows.js @@ -0,0 +1,216 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * @flow + */ + +'use strict'; + +const Platform = require('../../Utilities/Platform'); +const React = require('react'); +const {NativeComponent} = require('../../Renderer/shims/ReactNative'); + +const AndroidSwipeRefreshLayoutNativeComponent = require('./AndroidSwipeRefreshLayoutNativeComponent'); +const RCTRefreshControlNativeComponent = require('./RCTRefreshControlNativeComponent'); +const nullthrows = require('nullthrows'); + +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; + +let RefreshLayoutConsts; +if (Platform.OS === 'android') { + const AndroidSwipeRefreshLayout = require('../../ReactNative/UIManager').getViewManagerConfig( + 'AndroidSwipeRefreshLayout', + ); + RefreshLayoutConsts = AndroidSwipeRefreshLayout + ? AndroidSwipeRefreshLayout.Constants + : {SIZE: {}}; +} else { + RefreshLayoutConsts = {SIZE: {}}; +} + +type IOSProps = $ReadOnly<{| + /** + * The color of the refresh indicator. + */ + tintColor?: ?ColorValue, + /** + * Title color. + */ + titleColor?: ?ColorValue, + /** + * The title displayed under the refresh indicator. + */ + title?: ?string, +|}>; + +type AndroidProps = $ReadOnly<{| + /** + * Whether the pull to refresh functionality is enabled. + */ + enabled?: ?boolean, + /** + * The colors (at least one) that will be used to draw the refresh indicator. + */ + colors?: ?$ReadOnlyArray, + /** + * The background color of the refresh indicator. + */ + progressBackgroundColor?: ?ColorValue, + /** + * Size of the refresh indicator, see RefreshControl.SIZE. + */ + size?: ?( + | typeof RefreshLayoutConsts.SIZE.DEFAULT + | typeof RefreshLayoutConsts.SIZE.LARGE + ), + /** + * Progress view top offset + */ + progressViewOffset?: ?number, +|}>; + +export type RefreshControlProps = $ReadOnly<{| + ...ViewProps, + ...IOSProps, + ...AndroidProps, + + /** + * Called when the view starts refreshing. + */ + onRefresh?: ?() => mixed, + + /** + * Whether the view should be indicating an active refresh. + */ + refreshing: boolean, +|}>; + +/** + * This component is used inside a ScrollView or ListView to add pull to refresh + * functionality. When the ScrollView is at `scrollY: 0`, swiping down + * triggers an `onRefresh` event. + * + * ### Usage example + * + * ``` js + * class RefreshableList extends Component { + * constructor(props) { + * super(props); + * this.state = { + * refreshing: false, + * }; + * } + * + * _onRefresh() { + * this.setState({refreshing: true}); + * fetchData().then(() => { + * this.setState({refreshing: false}); + * }); + * } + * + * render() { + * return ( + * + * } + * ... + * > + * ... + * + * ); + * } + * ... + * } + * ``` + * + * __Note:__ `refreshing` is a controlled prop, this is why it needs to be set to true + * in the `onRefresh` function otherwise the refresh indicator will stop immediately. + */ +class RefreshControl extends React.Component { + static SIZE = RefreshLayoutConsts.SIZE; + + _setNativePropsOnRef: ?({refreshing: boolean}) => void; + _lastNativeRefreshing = false; + + componentDidMount() { + this._lastNativeRefreshing = this.props.refreshing; + } + + componentDidUpdate(prevProps: RefreshControlProps) { + // RefreshControl is a controlled component so if the native refreshing + // value doesn't match the current js refreshing prop update it to + // the js value. + if (this.props.refreshing !== prevProps.refreshing) { + this._lastNativeRefreshing = this.props.refreshing; + } else if ( + this.props.refreshing !== this._lastNativeRefreshing && + this._setNativePropsOnRef + ) { + this._setNativePropsOnRef({ + refreshing: this.props.refreshing, + }); + this._lastNativeRefreshing = this.props.refreshing; + } + } + + render() { + const setRef = ref => + (this._setNativePropsOnRef = ref ? ref.setNativeProps.bind(ref) : null); + if (Platform.OS === 'ios') { + const { + enabled, + colors, + progressBackgroundColor, + size, + progressViewOffset, + ...props + } = this.props; + return ( + + ); + } else if (Platform.OS === 'windows') { + const {...props} = this.props; + return ( + + ); + } else { + const {tintColor, titleColor, title, ...props} = this.props; + return ( + + ); + } + } + + _onRefresh = () => { + this._lastNativeRefreshing = true; + + this.props.onRefresh && this.props.onRefresh(); + + // The native component will start refreshing so force an update to + // make sure it stays in sync with the js component. + this.forceUpdate(); + }; +} + +module.exports = RefreshControl; diff --git a/vnext/src/Libraries/Components/ScrollView/ScrollView.windows.js b/vnext/src/Libraries/Components/ScrollView/ScrollView.windows.js new file mode 100644 index 00000000000..b5585efe087 --- /dev/null +++ b/vnext/src/Libraries/Components/ScrollView/ScrollView.windows.js @@ -0,0 +1,1278 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * @flow strict-local + */ + +'use strict'; + +const AnimatedImplementation = require('../../Animated/src/AnimatedImplementation'); +const Platform = require('../../Utilities/Platform'); +const React = require('react'); +const ReactNative = require('../../Renderer/shims/ReactNative'); +const ScrollResponder = require('../ScrollResponder'); +const ScrollViewStickyHeader = require('./ScrollViewStickyHeader'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const View = require('../View/View'); + +const dismissKeyboard = require('../../Utilities/dismissKeyboard'); +const flattenStyle = require('../../StyleSheet/flattenStyle'); +const invariant = require('invariant'); +const processDecelerationRate = require('./processDecelerationRate'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); +const resolveAssetSource = require('../../Image/resolveAssetSource'); +const splitLayoutProps = require('../../StyleSheet/splitLayoutProps'); + +import type { + PressEvent, + ScrollEvent, + LayoutEvent, + KeyboardEvent, +} from '../../Types/CoreEventTypes'; +import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; +import type {NativeMethodsMixinType} from '../../Renderer/shims/ReactNativeTypes'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {PointProp} from '../../StyleSheet/PointPropType'; + +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {State as ScrollResponderState} from '../ScrollResponder'; + +let AndroidScrollView; +let AndroidHorizontalScrollContentView; +let AndroidHorizontalScrollView; +let RCTScrollView; +let RCTScrollContentView; + +if (Platform.OS === 'android') { + AndroidScrollView = requireNativeComponent('RCTScrollView'); + AndroidHorizontalScrollView = requireNativeComponent( + 'AndroidHorizontalScrollView', + ); + AndroidHorizontalScrollContentView = requireNativeComponent( + 'AndroidHorizontalScrollContentView', + ); +} else if (Platform.OS === 'ios') { + RCTScrollView = requireNativeComponent('RCTScrollView'); + RCTScrollContentView = requireNativeComponent('RCTScrollContentView'); +} else { + RCTScrollView = requireNativeComponent('RCTScrollView'); + RCTScrollContentView = requireNativeComponent('RCTScrollContentView'); +} + +export type ScrollResponderType = { + ...ScrollView, + ...typeof ScrollResponder.Mixin, +}; + +type TouchableProps = $ReadOnly<{| + onTouchStart?: (event: PressEvent) => void, + onTouchMove?: (event: PressEvent) => void, + onTouchEnd?: (event: PressEvent) => void, + onTouchCancel?: (event: PressEvent) => void, + onTouchEndCapture?: (event: PressEvent) => void, +|}>; + +type IOSProps = $ReadOnly<{| + /** + * Controls whether iOS should automatically adjust the content inset + * for scroll views that are placed behind a navigation bar or + * tab bar/ toolbar. The default value is true. + * @platform ios + */ + automaticallyAdjustContentInsets?: ?boolean, + /** + * The amount by which the scroll view content is inset from the edges + * of the scroll view. Defaults to `{top: 0, left: 0, bottom: 0, right: 0}`. + * @platform ios + */ + contentInset?: ?EdgeInsetsProp, + /** + * Used to manually set the starting scroll offset. + * The default value is `{x: 0, y: 0}`. + * @platform ios + */ + contentOffset?: ?PointProp, + /** + * When true, the scroll view bounces when it reaches the end of the + * content if the content is larger then the scroll view along the axis of + * the scroll direction. When false, it disables all bouncing even if + * the `alwaysBounce*` props are true. The default value is true. + * @platform ios + */ + bounces?: ?boolean, + /** + * By default, ScrollView has an active pan responder that hijacks panresponders + * deeper in the render tree in order to prevent accidental touches while scrolling. + * However, in certain occasions (such as when using snapToInterval) in a vertical scrollview + * You may want to disable this behavior in order to prevent the ScrollView from blocking touches + */ + disableScrollViewPanResponder?: ?boolean, + /** + * When true, gestures can drive zoom past min/max and the zoom will animate + * to the min/max value at gesture end, otherwise the zoom will not exceed + * the limits. + * @platform ios + */ + bouncesZoom?: ?boolean, + /** + * When true, the scroll view bounces horizontally when it reaches the end + * even if the content is smaller than the scroll view itself. The default + * value is true when `horizontal={true}` and false otherwise. + * @platform ios + */ + alwaysBounceHorizontal?: ?boolean, + /** + * When true, the scroll view bounces vertically when it reaches the end + * even if the content is smaller than the scroll view itself. The default + * value is false when `horizontal={true}` and true otherwise. + * @platform ios + */ + alwaysBounceVertical?: ?boolean, + /** + * When true, the scroll view automatically centers the content when the + * content is smaller than the scroll view bounds; when the content is + * larger than the scroll view, this property has no effect. The default + * value is false. + * @platform ios + */ + centerContent?: ?boolean, + /** + * The style of the scroll indicators. + * + * - `'default'` (the default), same as `black`. + * - `'black'`, scroll indicator is black. This style is good against a light background. + * - `'white'`, scroll indicator is white. This style is good against a dark background. + * + * @platform ios + */ + indicatorStyle?: ?('default' | 'black' | 'white'), + /** + * When true, the ScrollView will try to lock to only vertical or horizontal + * scrolling while dragging. The default value is false. + * @platform ios + */ + directionalLockEnabled?: ?boolean, + /** + * When false, once tracking starts, won't try to drag if the touch moves. + * The default value is true. + * @platform ios + */ + canCancelContentTouches?: ?boolean, + /** + * When set, the scroll view will adjust the scroll position so that the first child that is + * currently visible and at or beyond `minIndexForVisible` will not change position. This is + * useful for lists that are loading content in both directions, e.g. a chat thread, where new + * messages coming in might otherwise cause the scroll position to jump. A value of 0 is common, + * but other values such as 1 can be used to skip loading spinners or other content that should + * not maintain position. + * + * The optional `autoscrollToTopThreshold` can be used to make the content automatically scroll + * to the top after making the adjustment if the user was within the threshold of the top before + * the adjustment was made. This is also useful for chat-like applications where you want to see + * new messages scroll into place, but not if the user has scrolled up a ways and it would be + * disruptive to scroll a bunch. + * + * Caveat 1: Reordering elements in the scrollview with this enabled will probably cause + * jumpiness and jank. It can be fixed, but there are currently no plans to do so. For now, + * don't re-order the content of any ScrollViews or Lists that use this feature. + * + * Caveat 2: This simply uses `contentOffset` and `frame.origin` in native code to compute + * visibility. Occlusion, transforms, and other complexity won't be taken into account as to + * whether content is "visible" or not. + * + * @platform ios + */ + maintainVisibleContentPosition?: ?$ReadOnly<{| + minIndexForVisible: number, + autoscrollToTopThreshold?: ?number, + |}>, + /** + * The maximum allowed zoom scale. The default value is 1.0. + * @platform ios + */ + maximumZoomScale?: ?number, + /** + * The minimum allowed zoom scale. The default value is 1.0. + * @platform ios + */ + minimumZoomScale?: ?number, + /** + * When true, ScrollView allows use of pinch gestures to zoom in and out. + * The default value is true. + * @platform ios + */ + pinchGestureEnabled?: ?boolean, + /** + * This controls how often the scroll event will be fired while scrolling + * (as a time interval in ms). A lower number yields better accuracy for code + * that is tracking the scroll position, but can lead to scroll performance + * problems due to the volume of information being send over the bridge. + * + * Values between 0 and 17ms indicate 60fps updates are needed and throttling + * will be disabled. + * + * If you do not need precise scroll position tracking, set this value higher + * to limit the information being sent across the bridge. + * + * The default value is zero, which results in the scroll event being sent only + * once each time the view is scrolled. + * + * @platform ios + */ + scrollEventThrottle?: ?number, + /** + * The amount by which the scroll view indicators are inset from the edges + * of the scroll view. This should normally be set to the same value as + * the `contentInset`. Defaults to `{0, 0, 0, 0}`. + * @platform ios + */ + scrollIndicatorInsets?: ?EdgeInsetsProp, + /** + * When true, the scroll view can be programmatically scrolled beyond its + * content size. The default value is false. + * @platform ios + */ + scrollToOverflowEnabled?: ?boolean, + /** + * When true, the scroll view scrolls to top when the status bar is tapped. + * The default value is true. + * @platform ios + */ + scrollsToTop?: ?boolean, + /** + * Fires when the scroll view scrolls to top after the status bar has been tapped + * @platform ios + */ + onScrollToTop?: (event: ScrollEvent) => void, + /** + * When true, shows a horizontal scroll indicator. + * The default value is true. + */ + showsHorizontalScrollIndicator?: ?boolean, + /** + * When `snapToInterval` is set, `snapToAlignment` will define the relationship + * of the snapping to the scroll view. + * + * - `'start'` (the default) will align the snap at the left (horizontal) or top (vertical) + * - `'center'` will align the snap in the center + * - `'end'` will align the snap at the right (horizontal) or bottom (vertical) + * + * @platform ios + */ + snapToAlignment?: ?('start' | 'center' | 'end'), + /** + * The current scale of the scroll view content. The default value is 1.0. + * @platform ios + */ + zoomScale?: ?number, + /** + * This property specifies how the safe area insets are used to modify the + * content area of the scroll view. The default value of this property is + * "never". Available on iOS 11 and later. + * @platform ios + */ + contentInsetAdjustmentBehavior?: ?( + | 'automatic' + | 'scrollableAxes' + | 'never' + | 'always' + ), + /** + * Experimental: specifies how much to adjust the content view by when using + * the keyboard to scroll. This value adjusts the content's horizontal offset. + * + * @platform macos + */ + horizontalLineScroll?: number, // TODO(macOS ISS#2323203) + /** + * Experimental: specifies how much to adjust the content view by when using + * the keyboard to scroll. This value adjusts the content's vertical offset. + * + * @platform macos + */ + verticalLineScroll?: number, // TODO(macOS ISS#2323203) + /** + * When true, ScrollView will emit updateChildFrames data in scroll events, + * otherwise will not compute or emit child frame data. This only exists + * to support legacy issues, `onLayout` should be used instead to retrieve + * frame data. + * The default value is false. + * @platform ios + */ + DEPRECATED_sendUpdatedChildFrames?: ?boolean, +|}>; + +type AndroidProps = $ReadOnly<{| + /** + * Enables nested scrolling for Android API level 21+. + * Nested scrolling is supported by default on iOS + * @platform android + */ + nestedScrollEnabled?: ?boolean, + /** + * Sometimes a scrollview takes up more space than its content fills. When this is + * the case, this prop will fill the rest of the scrollview with a color to avoid setting + * a background and creating unnecessary overdraw. This is an advanced optimization + * that is not needed in the general case. + * @platform android + */ + endFillColor?: ?ColorValue, + /** + * Tag used to log scroll performance on this scroll view. Will force + * momentum events to be turned on (see sendMomentumEvents). This doesn't do + * anything out of the box and you need to implement a custom native + * FpsListener for it to be useful. + * @platform android + */ + scrollPerfTag?: ?string, + /** + * Used to override default value of overScroll mode. + * + * Possible values: + * + * - `'auto'` - Default value, allow a user to over-scroll + * this view only if the content is large enough to meaningfully scroll. + * - `'always'` - Always allow a user to over-scroll this view. + * - `'never'` - Never allow a user to over-scroll this view. + * + * @platform android + */ + overScrollMode?: ?('auto' | 'always' | 'never'), + /** + * Causes the scrollbars not to turn transparent when they are not in use. + * The default value is false. + * + * @platform android + */ + persistentScrollbar?: ?boolean, +|}>; + +type VRProps = $ReadOnly<{| + /** + * Optionally an image can be used for the scroll bar thumb. This will + * override the color. While the image is loading or the image fails to + * load the color will be used instead. Use an alpha of 0 in the color + * to avoid seeing it while the image is loading. + * + * - `uri` - a string representing the resource identifier for the image, which + * should be either a local file path or the name of a static image resource + * - `number` - Opaque type returned by something like + * `import IMAGE from './image.jpg'`. + * @platform vr + */ + scrollBarThumbImage?: ?($ReadOnly<{||}> | number), // Opaque type returned by import IMAGE from './image.jpg' +|}>; + +export type Props = $ReadOnly<{| + ...ViewProps, + ...TouchableProps, + ...IOSProps, + ...AndroidProps, + ...VRProps, + + /** + * These styles will be applied to the scroll view content container which + * wraps all of the child views. Example: + * + * ``` + * return ( + * + * + * ); + * ... + * const styles = StyleSheet.create({ + * contentContainer: { + * paddingVertical: 20 + * } + * }); + * ``` + */ + contentContainerStyle?: ?ViewStyleProp, + /** + * When true, the scroll view stops on the next index (in relation to scroll + * position at release) regardless of how fast the gesture is. This can be + * used for horizontal pagination when the page is less than the width of + * the ScrollView. The default value is false. + */ + disableIntervalMomentum?: ?boolean, + /** + * A floating-point number that determines how quickly the scroll view + * decelerates after the user lifts their finger. You may also use string + * shortcuts `"normal"` and `"fast"` which match the underlying iOS settings + * for `UIScrollViewDecelerationRateNormal` and + * `UIScrollViewDecelerationRateFast` respectively. + * + * - `'normal'`: 0.998 on iOS, 0.985 on Android (the default) + * - `'fast'`: 0.99 on iOS, 0.9 on Android + */ + decelerationRate?: ?('fast' | 'normal' | number), + /** + * When true, the scroll view's children are arranged horizontally in a row + * instead of vertically in a column. The default value is false. + */ + horizontal?: ?boolean, + /** + * If sticky headers should stick at the bottom instead of the top of the + * ScrollView. This is usually used with inverted ScrollViews. + */ + invertStickyHeaders?: ?boolean, + /** + * Determines whether the keyboard gets dismissed in response to a drag. + * + * *Cross platform* + * + * - `'none'` (the default), drags do not dismiss the keyboard. + * - `'on-drag'`, the keyboard is dismissed when a drag begins. + * + * *iOS Only* + * + * - `'interactive'`, the keyboard is dismissed interactively with the drag and moves in + * synchrony with the touch; dragging upwards cancels the dismissal. + * On android this is not supported and it will have the same behavior as 'none'. + */ + keyboardDismissMode?: ?( + | 'none' // default + | 'on-drag' // cross-platform + | 'interactive' + ), // ios only + /** + * Determines when the keyboard should stay visible after a tap. + * + * - `'never'` (the default), tapping outside of the focused text input when the keyboard + * is up dismisses the keyboard. When this happens, children won't receive the tap. + * - `'always'`, the keyboard will not dismiss automatically, and the scroll view will not + * catch taps, but children of the scroll view can catch taps. + * - `'handled'`, the keyboard will not dismiss automatically when the tap was handled by + * a children, (or captured by an ancestor). + * - `false`, deprecated, use 'never' instead + * - `true`, deprecated, use 'always' instead + */ + keyboardShouldPersistTaps?: ?('always' | 'never' | 'handled' | true | false), + /** + * Called when the momentum scroll starts (scroll which occurs as the ScrollView glides to a stop). + */ + onMomentumScrollBegin?: (event: ScrollEvent) => void, + /** + * Called when the momentum scroll ends (scroll which occurs as the ScrollView glides to a stop). + */ + onMomentumScrollEnd?: (event: ScrollEvent) => void, + + /** + * Fires at most once per frame during scrolling. The frequency of the + * events can be controlled using the `scrollEventThrottle` prop. + */ + onScroll?: (event: ScrollEvent) => void, + /** + * Called when the user begins to drag the scroll view. + */ + onScrollBeginDrag?: (event: ScrollEvent) => void, + /** + * Called when the user stops dragging the scroll view and it either stops + * or begins to glide. + */ + onScrollEndDrag?: (event: ScrollEvent) => void, + /** + * Called when scrollable content view of the ScrollView changes. + * + * Handler function is passed the content width and content height as parameters: + * `(contentWidth, contentHeight)` + * + * It's implemented using onLayout handler attached to the content container + * which this ScrollView renders. + */ + onContentSizeChange?: (contentWidth: number, contentHeight: number) => void, + onKeyboardDidShow?: (event: PressEvent) => void, + /** + * When true, the scroll view stops on multiples of the scroll view's size + * when scrolling. This can be used for horizontal pagination. The default + * value is false. + * + * Note: Vertical pagination is not supported on Android. + */ + pagingEnabled?: ?boolean, + + /** + * When false, the view cannot be scrolled via touch interaction. + * The default value is true. + * + * Note that the view can always be scrolled by calling `scrollTo`. + */ + scrollEnabled?: ?boolean, + /** + * When true, shows a vertical scroll indicator. + * The default value is true. + */ + showsVerticalScrollIndicator?: ?boolean, + /** + * An array of child indices determining which children get docked to the + * top of the screen when scrolling. For example, passing + * `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the + * top of the scroll view. This property is not supported in conjunction + * with `horizontal={true}`. + */ + stickyHeaderIndices?: ?$ReadOnlyArray, + /** + * When set, causes the scroll view to stop at multiples of the value of + * `snapToInterval`. This can be used for paginating through children + * that have lengths smaller than the scroll view. Typically used in + * combination with `snapToAlignment` and `decelerationRate="fast"`. + * + * Overrides less configurable `pagingEnabled` prop. + */ + snapToInterval?: ?number, + /** + * When set, causes the scroll view to stop at the defined offsets. + * This can be used for paginating through variously sized children + * that have lengths smaller than the scroll view. Typically used in + * combination with `decelerationRate="fast"`. + * + * Overrides less configurable `pagingEnabled` and `snapToInterval` props. + */ + snapToOffsets?: ?$ReadOnlyArray, + /** + * Use in conjuction with `snapToOffsets`. By default, the beginning + * of the list counts as a snap offset. Set `snapToStart` to false to disable + * this behavior and allow the list to scroll freely between its start and + * the first `snapToOffsets` offset. + * The default value is true. + */ + snapToStart?: ?boolean, + /** + * Use in conjuction with `snapToOffsets`. By default, the end + * of the list counts as a snap offset. Set `snapToEnd` to false to disable + * this behavior and allow the list to scroll freely between its end and + * the last `snapToOffsets` offset. + * The default value is true. + */ + snapToEnd?: ?boolean, + /** + * Experimental: When true, offscreen child views (whose `overflow` value is + * `hidden`) are removed from their native backing superview when offscreen. + * This can improve scrolling performance on long lists. The default value is + * true. + */ + removeClippedSubviews?: ?boolean, + /** + * A RefreshControl component, used to provide pull-to-refresh + * functionality for the ScrollView. Only works for vertical ScrollViews + * (`horizontal` prop must be `false`). + * + * See [RefreshControl](docs/refreshcontrol.html). + */ + // $FlowFixMe - how to handle generic type without existential opereator? + refreshControl?: ?React.Element, + children?: React.Node, +|}>; + +type State = {| + layoutHeight: ?number, + ...ScrollResponderState, +|}; + +function createScrollResponder( + node: React.ElementRef, +): typeof ScrollResponder.Mixin { + const scrollResponder = {...ScrollResponder.Mixin}; + + for (const key in scrollResponder) { + if (typeof scrollResponder[key] === 'function') { + scrollResponder[key] = scrollResponder[key].bind(node); + } + } + + return scrollResponder; +} + +/** + * Component that wraps platform ScrollView while providing + * integration with touch locking "responder" system. + * + * Keep in mind that ScrollViews must have a bounded height in order to work, + * since they contain unbounded-height children into a bounded container (via + * a scroll interaction). In order to bound the height of a ScrollView, either + * set the height of the view directly (discouraged) or make sure all parent + * views have bounded height. Forgetting to transfer `{flex: 1}` down the + * view stack can lead to errors here, which the element inspector makes + * easy to debug. + * + * Doesn't yet support other contained responders from blocking this scroll + * view from becoming the responder. + * + * + * `` vs [``](/react-native/docs/flatlist.html) - which one to use? + * + * `ScrollView` simply renders all its react child components at once. That + * makes it very easy to understand and use. + * + * On the other hand, this has a performance downside. Imagine you have a very + * long list of items you want to display, maybe several screens worth of + * content. Creating JS components and native views for everything all at once, + * much of which may not even be shown, will contribute to slow rendering and + * increased memory usage. + * + * This is where `FlatList` comes into play. `FlatList` renders items lazily, + * just when they are about to appear, and removes items that scroll way off + * screen to save memory and processing time. + * + * `FlatList` is also handy if you want to render separators between your items, + * multiple columns, infinite scroll loading, or any number of other features it + * supports out of the box. + */ +class ScrollView extends React.Component { + /** + * Part 1: Removing ScrollResponder.Mixin: + * + * 1. Mixin methods should be flow typed. That's why we create a + * copy of ScrollResponder.Mixin and attach it to this._scrollResponder. + * Otherwise, we'd have to manually declare each method on the component + * class and assign it a flow type. + * 2. Mixin methods can call component methods, and access the component's + * props and state. So, we need to bind all mixin methods to the + * component instance. + * 3. Continued... + */ + _scrollResponder: typeof ScrollResponder.Mixin = createScrollResponder(this); + + constructor(props: Props) { + super(props); + + /** + * Part 2: Removing ScrollResponder.Mixin + * + * 3. Mixin methods access other mixin methods via dynamic dispatch using + * this. Since mixin methods are bound to the component instance, we need + * to copy all mixin methods to the component instance. This is also + * necessary because getScrollResponder() is a public method that returns + * an object that can be used to execute all scrollResponder methods. + * Since the object returned from that method is the ScrollView instance, + * we need to bind all mixin methods to the ScrollView instance. + */ + for (const key in ScrollResponder.Mixin) { + if ( + typeof ScrollResponder.Mixin[key] === 'function' && + key.startsWith('scrollResponder') + ) { + // $FlowFixMe - dynamically adding properties to a class + (this: any)[key] = ScrollResponder.Mixin[key].bind(this); + } + } + + /** + * Part 3: Removing ScrollResponder.Mixin + * + * 4. Mixins can initialize properties and use properties on the component + * instance. + */ + Object.keys(ScrollResponder.Mixin) + .filter(key => typeof ScrollResponder.Mixin[key] !== 'function') + .forEach(key => { + // $FlowFixMe - dynamically adding properties to a class + (this: any)[key] = ScrollResponder.Mixin[key]; + }); + } + + _scrollAnimatedValue: AnimatedImplementation.Value = new AnimatedImplementation.Value( + 0, + ); + _scrollAnimatedValueAttachment: ?{detach: () => void} = null; + _stickyHeaderRefs: Map = new Map(); + _headerLayoutYs: Map = new Map(); + + state = { + layoutHeight: null, + ...ScrollResponder.Mixin.scrollResponderMixinGetInitialState(), + }; + + UNSAFE_componentWillMount() { + this._scrollResponder.UNSAFE_componentWillMount(); + this._scrollAnimatedValue = new AnimatedImplementation.Value( + this.props.contentOffset ? this.props.contentOffset.y : 0, + ); + this._scrollAnimatedValue.setOffset( + /* $FlowFixMe(>=0.98.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.98 was deployed. To see the error delete this + * comment and run Flow. */ + this.props.contentInset ? this.props.contentInset.top : 0, + ); + this._stickyHeaderRefs = new Map(); + this._headerLayoutYs = new Map(); + } + + UNSAFE_componentWillReceiveProps(nextProps: Props) { + const currentContentInsetTop = this.props.contentInset + ? this.props.contentInset.top + : 0; + const nextContentInsetTop = nextProps.contentInset + ? nextProps.contentInset.top + : 0; + if (currentContentInsetTop !== nextContentInsetTop) { + this._scrollAnimatedValue.setOffset(nextContentInsetTop || 0); + } + } + + componentDidMount() { + this._updateAnimatedNodeAttachment(); + } + + componentDidUpdate() { + this._updateAnimatedNodeAttachment(); + } + + componentWillUnmount() { + this._scrollResponder.componentWillUnmount(); + if (this._scrollAnimatedValueAttachment) { + this._scrollAnimatedValueAttachment.detach(); + } + } + + setNativeProps(props: {[key: string]: mixed}) { + this._scrollViewRef && this._scrollViewRef.setNativeProps(props); + } + + /** + * Returns a reference to the underlying scroll responder, which supports + * operations like `scrollTo`. All ScrollView-like components should + * implement this method so that they can be composed while providing access + * to the underlying scroll responder's methods. + */ + getScrollResponder(): ScrollResponderType { + // $FlowFixMe - overriding type to include ScrollResponder.Mixin + return ((this: any): ScrollResponderType); + } + + getScrollableNode(): ?number { + return ReactNative.findNodeHandle(this._scrollViewRef); + } + + getInnerViewNode(): ?number { + return ReactNative.findNodeHandle(this._innerViewRef); + } + + getNativeScrollRef(): ?ScrollView { + return this._scrollViewRef; + } + + /** + * Scrolls to a given x, y offset, either immediately or with a smooth animation. + * + * Example: + * + * `scrollTo({x: 0, y: 0, animated: true})` + * + * Note: The weird function signature is due to the fact that, for historical reasons, + * the function also accepts separate arguments as an alternative to the options object. + * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED. + */ + scrollTo( + options?: {x?: number, y?: number, animated?: boolean} | number, + deprecatedX?: number, + deprecatedAnimated?: boolean, + ) { + let x, y, animated; + if (typeof options === 'number') { + console.warn( + '`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, ' + + 'animated: true})` instead.', + ); + y = options; + x = deprecatedX; + animated = deprecatedAnimated; + } else if (options) { + y = options.y; + x = options.x; + animated = options.animated; + } + this._scrollResponder.scrollResponderScrollTo({ + x: x || 0, + y: y || 0, + animated: animated !== false, + }); + } + + /** + * If this is a vertical ScrollView scrolls to the bottom. + * If this is a horizontal ScrollView scrolls to the right. + * + * Use `scrollToEnd({animated: true})` for smooth animated scrolling, + * `scrollToEnd({animated: false})` for immediate scrolling. + * If no options are passed, `animated` defaults to true. + */ + scrollToEnd(options?: ?{animated?: boolean}) { + // Default to true + const animated = (options && options.animated) !== false; + this._scrollResponder.scrollResponderScrollToEnd({ + animated: animated, + }); + } + + /** + * Deprecated, use `scrollTo` instead. + */ + scrollWithoutAnimationTo(y: number = 0, x: number = 0) { + console.warn( + '`scrollWithoutAnimationTo` is deprecated. Use `scrollTo` instead', + ); + this.scrollTo({x, y, animated: false}); + } + + /** + * Displays the scroll indicators momentarily. + * + * @platform ios + */ + flashScrollIndicators() { + this._scrollResponder.scrollResponderFlashScrollIndicators(); + } + + _getKeyForIndex(index, childArray) { + const child = childArray[index]; + return child && child.key; + } + + _updateAnimatedNodeAttachment() { + if (this._scrollAnimatedValueAttachment) { + this._scrollAnimatedValueAttachment.detach(); + } + if ( + this.props.stickyHeaderIndices && + this.props.stickyHeaderIndices.length > 0 + ) { + this._scrollAnimatedValueAttachment = AnimatedImplementation.attachNativeEvent( + this._scrollViewRef, + 'onScroll', + [{nativeEvent: {contentOffset: {y: this._scrollAnimatedValue}}}], + ); + } + } + + _setStickyHeaderRef(key, ref) { + if (ref) { + this._stickyHeaderRefs.set(key, ref); + } else { + this._stickyHeaderRefs.delete(key); + } + } + + _onStickyHeaderLayout(index, event, key) { + const {stickyHeaderIndices} = this.props; + if (!stickyHeaderIndices) { + return; + } + const childArray = React.Children.toArray(this.props.children); + if (key !== this._getKeyForIndex(index, childArray)) { + // ignore stale layout update + return; + } + + const layoutY = event.nativeEvent.layout.y; + this._headerLayoutYs.set(key, layoutY); + + const indexOfIndex = stickyHeaderIndices.indexOf(index); + const previousHeaderIndex = stickyHeaderIndices[indexOfIndex - 1]; + if (previousHeaderIndex != null) { + const previousHeader = this._stickyHeaderRefs.get( + this._getKeyForIndex(previousHeaderIndex, childArray), + ); + previousHeader && previousHeader.setNextHeaderY(layoutY); + } + } + + // [TODO(macOS ISS#2323203) + _handleKeyDown = (e: KeyboardEvent) => { + if (this.props.onKeyDown) { + this.props.onKeyDown(e); + } else { + const event = e.nativeEvent; + const key = event.key; + const kMinScrollOffset = 10; + + if (Platform.OS === 'macos') { + if (key === 'PAGE_UP') { + this._handleScrollByKeyDown(event, { + x: event.contentOffset.x, + y: event.contentOffset.y + -event.layoutMeasurement.height, + }); + } else if (key === 'PAGE_DOWN') { + this._handleScrollByKeyDown(event, { + x: event.contentOffset.x, + y: event.contentOffset.y + event.layoutMeasurement.height, + }); + } else if (key === 'LEFT_ARROW') { + this._handleScrollByKeyDown(event, { + x: + event.contentOffset.x + + -(this.props.horizontalLineScroll === undefined + ? this.props.horizontalLineScroll + : kMinScrollOffset), + y: event.contentOffset.y, + }); + } else if (key === 'RIGHT_ARROW') { + this._handleScrollByKeyDown(event, { + x: + event.contentOffset.x + + (this.props.horizontalLineScroll === undefined + ? this.props.horizontalLineScroll + : kMinScrollOffset), + y: event.contentOffset.y, + }); + } else if (key === 'DOWN_ARROW') { + this._handleScrollByKeyDown(event, { + x: event.contentOffset.x, + y: + event.contentOffset.y + + (this.props.verticalLineScroll === undefined + ? this.props.verticalLineScroll + : kMinScrollOffset), + }); + } else if (key === 'UP_ARROW') { + this._handleScrollByKeyDown(event, { + x: event.contentOffset.x, + y: + event.contentOffset.y + + -(this.props.verticalLineScroll === undefined + ? this.props.verticalLineScroll + : kMinScrollOffset), + }); + } + } + } + }; + + _handleScrollByKeyDown = (e: ScrollEvent, newOffset) => { + const maxX = + e.nativeEvent.contentSize.width - e.nativeEvent.layoutMeasurement.width; + const maxY = + e.nativeEvent.contentSize.height - e.nativeEvent.layoutMeasurement.height; + this.scrollTo({ + x: Math.max(0, Math.min(maxX, newOffset.x)), + y: Math.max(0, Math.min(maxY, newOffset.y)), + }); + }; // ]TODO(macOS ISS#2323203) + + _handleScroll = (e: ScrollEvent) => { + if (__DEV__) { + if ( + this.props.onScroll && + this.props.scrollEventThrottle == null && + (Platform.OS === 'ios' || Platform.OS === 'macos') // TODO(macOS ISS#2323203) + ) { + console.log( + 'You specified `onScroll` on a but not ' + + '`scrollEventThrottle`. You will only receive one event. ' + + 'Using `16` you get all the events but be aware that it may ' + + "cause frame drops, use a bigger number if you don't need as " + + 'much precision.', + ); + } + } + if (Platform.OS === 'android') { + if ( + this.props.keyboardDismissMode === 'on-drag' && + this.state.isTouching + ) { + dismissKeyboard(); + } + } + this._scrollResponder.scrollResponderHandleScroll(e); + }; + + _handleLayout = (e: LayoutEvent) => { + if (this.props.invertStickyHeaders === true) { + this.setState({layoutHeight: e.nativeEvent.layout.height}); + } + if (this.props.onLayout) { + this.props.onLayout(e); + } + }; + + _handleContentOnLayout = (e: LayoutEvent) => { + const {width, height} = e.nativeEvent.layout; + this.props.onContentSizeChange && + this.props.onContentSizeChange(width, height); + }; + + _scrollViewRef: ?ScrollView = null; + _setScrollViewRef = (ref: ?ScrollView) => { + this._scrollViewRef = ref; + }; + + _innerViewRef: ?NativeMethodsMixinType = null; + _setInnerViewRef = (ref: ?NativeMethodsMixinType) => { + this._innerViewRef = ref; + }; + + render() { + let ScrollViewClass; + let ScrollContentContainerViewClass; + if (Platform.OS === 'android') { + if (this.props.horizontal === true) { + ScrollViewClass = AndroidHorizontalScrollView; + ScrollContentContainerViewClass = AndroidHorizontalScrollContentView; + } else { + ScrollViewClass = AndroidScrollView; + ScrollContentContainerViewClass = View; + } + } else { + ScrollViewClass = RCTScrollView; + ScrollContentContainerViewClass = RCTScrollContentView; + } + + invariant( + ScrollViewClass !== undefined, + 'ScrollViewClass must not be undefined', + ); + + invariant( + ScrollContentContainerViewClass !== undefined, + 'ScrollContentContainerViewClass must not be undefined', + ); + + const contentContainerStyle = [ + this.props.horizontal === true && styles.contentContainerHorizontal, + this.props.contentContainerStyle, + ]; + if (__DEV__ && this.props.style !== undefined) { + const style = flattenStyle(this.props.style); + const childLayoutProps = ['alignItems', 'justifyContent'].filter( + prop => style && style[prop] !== undefined, + ); + invariant( + childLayoutProps.length === 0, + 'ScrollView child layout (' + + JSON.stringify(childLayoutProps) + + ') must be applied through the contentContainerStyle prop.', + ); + } + + let contentSizeChangeProps = {}; + if (this.props.onContentSizeChange) { + contentSizeChangeProps = { + onLayout: this._handleContentOnLayout, + }; + } + + const {stickyHeaderIndices} = this.props; + let children = this.props.children; + + if (stickyHeaderIndices != null && stickyHeaderIndices.length > 0) { + const childArray = React.Children.toArray(this.props.children); + + children = childArray.map((child, index) => { + const indexOfIndex = child ? stickyHeaderIndices.indexOf(index) : -1; + if (indexOfIndex > -1) { + const key = child.key; + const nextIndex = stickyHeaderIndices[indexOfIndex + 1]; + return ( + this._setStickyHeaderRef(key, ref)} + nextHeaderLayoutY={this._headerLayoutYs.get( + this._getKeyForIndex(nextIndex, childArray), + )} + onLayout={event => this._onStickyHeaderLayout(index, event, key)} + scrollAnimatedValue={this._scrollAnimatedValue} + inverted={this.props.invertStickyHeaders} + scrollViewHeight={this.state.layoutHeight}> + {child} + + ); + } else { + return child; + } + }); + } + + const hasStickyHeaders = + Array.isArray(stickyHeaderIndices) && stickyHeaderIndices.length > 0; + + const contentContainer = ( + + {children} + + ); + + const alwaysBounceHorizontal = + this.props.alwaysBounceHorizontal !== undefined + ? this.props.alwaysBounceHorizontal + : this.props.horizontal; + + const alwaysBounceVertical = + this.props.alwaysBounceVertical !== undefined + ? this.props.alwaysBounceVertical + : !this.props.horizontal; + + const DEPRECATED_sendUpdatedChildFrames = !!this.props + .DEPRECATED_sendUpdatedChildFrames; + + const baseStyle = + this.props.horizontal === true + ? styles.baseHorizontal + : styles.baseVertical; + const props = { + ...this.props, + alwaysBounceHorizontal, + alwaysBounceVertical, + style: [baseStyle, this.props.style], + // Override the onContentSizeChange from props, since this event can + // bubble up from TextInputs + onContentSizeChange: null, + onKeyDown: this._handleKeyDown, // TODO(macOS ISS#2323203) + onLayout: this._handleLayout, + onMomentumScrollBegin: this._scrollResponder + .scrollResponderHandleMomentumScrollBegin, + onMomentumScrollEnd: this._scrollResponder + .scrollResponderHandleMomentumScrollEnd, + onResponderGrant: this._scrollResponder + .scrollResponderHandleResponderGrant, + onResponderReject: this._scrollResponder + .scrollResponderHandleResponderReject, + onResponderRelease: this._scrollResponder + .scrollResponderHandleResponderRelease, + // $FlowFixMe + onResponderTerminate: this._scrollResponder + .scrollResponderHandleTerminate, + onResponderTerminationRequest: this._scrollResponder + .scrollResponderHandleTerminationRequest, + onScrollBeginDrag: this._scrollResponder + .scrollResponderHandleScrollBeginDrag, + onScrollEndDrag: this._scrollResponder.scrollResponderHandleScrollEndDrag, + onScrollShouldSetResponder: this._scrollResponder + .scrollResponderHandleScrollShouldSetResponder, + onStartShouldSetResponder: this._scrollResponder + .scrollResponderHandleStartShouldSetResponder, + onStartShouldSetResponderCapture: this._scrollResponder + .scrollResponderHandleStartShouldSetResponderCapture, + onTouchEnd: this._scrollResponder.scrollResponderHandleTouchEnd, + onTouchMove: this._scrollResponder.scrollResponderHandleTouchMove, + onTouchStart: this._scrollResponder.scrollResponderHandleTouchStart, + onTouchCancel: this._scrollResponder.scrollResponderHandleTouchCancel, + onScroll: this._handleScroll, + scrollBarThumbImage: resolveAssetSource(this.props.scrollBarThumbImage), + scrollEventThrottle: hasStickyHeaders + ? 1 + : this.props.scrollEventThrottle, + sendMomentumEvents: + this.props.onMomentumScrollBegin || this.props.onMomentumScrollEnd + ? true + : false, + DEPRECATED_sendUpdatedChildFrames, + // default to true + snapToStart: this.props.snapToStart !== false, + // default to true + snapToEnd: this.props.snapToEnd !== false, + // pagingEnabled is overridden by snapToInterval / snapToOffsets + pagingEnabled: Platform.select({ + // on iOS, pagingEnabled must be set to false to have snapToInterval / snapToOffsets work + ios: + this.props.pagingEnabled === true && + this.props.snapToInterval == null && + this.props.snapToOffsets == null, + // [TODO(macOS ISS#2323203) + macos: + this.props.pagingEnabled === true && + this.props.snapToInterval == null && + this.props.snapToOffsets == null, // ]TODO(macOS ISS#2323203) + // on Android, pagingEnabled must be set to true to have snapToInterval / snapToOffsets work + android: + this.props.pagingEnabled === true || + this.props.snapToInterval != null || + this.props.snapToOffsets != null, + }), + }; + + const {decelerationRate} = this.props; + if (decelerationRate != null) { + props.decelerationRate = processDecelerationRate(decelerationRate); + } + + const refreshControl = this.props.refreshControl; + + if (refreshControl) { + if (Platform.OS === 'ios') { + // On iOS the RefreshControl is a child of the ScrollView. + // tvOS lacks native support for RefreshControl, so don't include it in that case + return ( + // $FlowFixMe + + {Platform.isTV ? null : refreshControl} + {contentContainer} + + ); + } else if (Platform.OS === 'android') { + // On Android wrap the ScrollView with a AndroidSwipeRefreshLayout. + // Since the ScrollView is wrapped add the style props to the + // AndroidSwipeRefreshLayout and use flex: 1 for the ScrollView. + // Note: we should split props.style on the inner and outer props + // however, the ScrollView still needs the baseStyle to be scrollable + const {outer, inner} = splitLayoutProps(flattenStyle(props.style)); + return React.cloneElement( + refreshControl, + {style: [baseStyle, outer]}, + + {contentContainer} + , + ); + } else if (Platform.OS === 'windows') { + const {outer, inner} = splitLayoutProps(flattenStyle(props.style)); + return React.cloneElement( + refreshControl, + {style: [baseStyle, outer]}, + + {contentContainer} + , + ); + } + } + return ( + // $FlowFixMe + + {contentContainer} + + ); + } +} + +const styles = StyleSheet.create({ + baseVertical: { + flexGrow: 1, + flexShrink: 1, + flexDirection: 'column', + overflow: 'scroll', + }, + baseHorizontal: { + flexGrow: 1, + flexShrink: 1, + flexDirection: 'row', + overflow: 'scroll', + }, + contentContainerHorizontal: { + flexDirection: 'row', + }, +}); + +module.exports = ScrollView; From 79d717d0899bb134fc92de5cd1747e8ea259ff07 Mon Sep 17 00:00:00 2001 From: React-Native-Windows Bot <53619745+rnbot@users.noreply.github.com> Date: Thu, 7 Nov 2019 17:37:11 +0000 Subject: [PATCH 10/29] applying package updates ***NO_CI*** --- ...ative-windows-2019-11-05-11-31-02-refresh2.json | 8 -------- packages/E2ETest/package.json | 2 +- .../microsoft-reactnative-sampleapps/package.json | 2 +- packages/playground/package.json | 2 +- .../react-native-windows-extended/package.json | 2 +- vnext/CHANGELOG.json | 14 ++++++++++++++ vnext/CHANGELOG.md | 8 +++++++- vnext/package.json | 2 +- 8 files changed, 26 insertions(+), 14 deletions(-) delete mode 100644 change/react-native-windows-2019-11-05-11-31-02-refresh2.json diff --git a/change/react-native-windows-2019-11-05-11-31-02-refresh2.json b/change/react-native-windows-2019-11-05-11-31-02-refresh2.json deleted file mode 100644 index f585c26cdd1..00000000000 --- a/change/react-native-windows-2019-11-05-11-31-02-refresh2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "prerelease", - "comment": "Support refreshControl", - "packageName": "react-native-windows", - "email": "dida@ntdev.microsoft.com", - "commit": "7f7144f6708042a8e4983a143ef2733ac81abea5", - "date": "2019-11-05T19:31:02.270Z" -} \ No newline at end of file diff --git a/packages/E2ETest/package.json b/packages/E2ETest/package.json index 5c55c5949c8..a8d294dbf44 100644 --- a/packages/E2ETest/package.json +++ b/packages/E2ETest/package.json @@ -24,7 +24,7 @@ "dependencies": { "react": "16.8.6", "react-native": "https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.16.tar.gz", - "react-native-windows": "0.60.0-vnext.65", + "react-native-windows": "0.60.0-vnext.66", "react-native-windows-extended": "0.60.17", "rnpm-plugin-windows": "^0.3.8" }, diff --git a/packages/microsoft-reactnative-sampleapps/package.json b/packages/microsoft-reactnative-sampleapps/package.json index 87c4eea3068..98d0bbed62f 100644 --- a/packages/microsoft-reactnative-sampleapps/package.json +++ b/packages/microsoft-reactnative-sampleapps/package.json @@ -14,7 +14,7 @@ "dependencies": { "react": "16.8.6", "react-native": "https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.16.tar.gz", - "react-native-windows": "0.60.0-vnext.65", + "react-native-windows": "0.60.0-vnext.66", "react-native-windows-extended": "0.60.17", "rnpm-plugin-windows": "^0.3.8" }, diff --git a/packages/playground/package.json b/packages/playground/package.json index 7048f653098..a5714d51374 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -14,7 +14,7 @@ "dependencies": { "react": "16.8.6", "react-native": "https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.16.tar.gz", - "react-native-windows": "0.60.0-vnext.65", + "react-native-windows": "0.60.0-vnext.66", "react-native-windows-extended": "0.60.17", "rnpm-plugin-windows": "^0.3.8" }, diff --git a/packages/react-native-windows-extended/package.json b/packages/react-native-windows-extended/package.json index 6ca688b991c..621bfade27c 100644 --- a/packages/react-native-windows-extended/package.json +++ b/packages/react-native-windows-extended/package.json @@ -18,7 +18,7 @@ "license": "MIT", "private": false, "dependencies": { - "react-native-windows": "0.60.0-vnext.65" + "react-native-windows": "0.60.0-vnext.66" }, "devDependencies": { "@react-native-community/eslint-config": "^0.0.5", diff --git a/vnext/CHANGELOG.json b/vnext/CHANGELOG.json index b73e06a8ef4..103ce2e89ab 100644 --- a/vnext/CHANGELOG.json +++ b/vnext/CHANGELOG.json @@ -1,6 +1,20 @@ { "name": "react-native-windows", "entries": [ + { + "date": "Thu, 07 Nov 2019 17:37:11 GMT", + "tag": "react-native-windows_v0.60.0-vnext.66", + "version": "0.60.0-vnext.66", + "comments": { + "prerelease": [ + { + "comment": "Support refreshControl", + "author": "dida@ntdev.microsoft.com", + "commit": "7f7144f6708042a8e4983a143ef2733ac81abea5" + } + ] + } + }, { "date": "Wed, 06 Nov 2019 23:32:18 GMT", "tag": "react-native-windows_v0.60.0-vnext.65", diff --git a/vnext/CHANGELOG.md b/vnext/CHANGELOG.md index 047653ad5e4..b4ac4860786 100644 --- a/vnext/CHANGELOG.md +++ b/vnext/CHANGELOG.md @@ -1,7 +1,13 @@ # Change Log - react-native-windows -This log was last generated on Wed, 06 Nov 2019 13:58:14 GMT and should not be manually modified. +This log was last generated on Thu, 07 Nov 2019 17:37:11 GMT and should not be manually modified. +## 0.60.0-vnext.66 +Thu, 07 Nov 2019 17:37:11 GMT + +### Changes + +- Support refreshControl (dida@ntdev.microsoft.com) ## 0.60.0-vnext.65 Wed, 06 Nov 2019 13:58:14 GMT diff --git a/vnext/package.json b/vnext/package.json index 97d1ea755f8..ec537d13203 100644 --- a/vnext/package.json +++ b/vnext/package.json @@ -1,6 +1,6 @@ { "name": "react-native-windows", - "version": "0.60.0-vnext.65", + "version": "0.60.0-vnext.66", "license": "MIT", "repository": { "type": "git", From f0b944f50f2887897d9559de4ee33f480627faf4 Mon Sep 17 00:00:00 2001 From: Jon Thysell Date: Thu, 7 Nov 2019 16:26:31 -0800 Subject: [PATCH 11/29] ViewManager Command Updates (#3614) * Added command to CustomUserControlViewManagerCPP, #3600 * Added support for simpler C# view manager commands signatures * Added support for object properties for view managers, #3613 * Added documentation for C++ view manager * Added documentation for ViewManager commands, #3599 --- ...indows-2019-11-06-16-45-50-vmcommands.json | 8 + .../index.windows.js | 28 +- .../windows/SampleAppCPP/DebugConsole.h | 3 +- .../CustomUserControlViewManagerCPP.cpp | 26 +- .../CustomUserControlViewManagerCPP.h | 12 +- .../windows/SampleLibraryCPP/DebugHelpers.cpp | 22 ++ .../windows/SampleLibraryCPP/DebugHelpers.h | 18 + .../SampleLibraryCPP/SampleLibraryCPP.vcxproj | 2 + .../SampleLibraryCPP.vcxproj.filters | 2 + .../SampleLibraryCPP/SampleModuleCPP.h | 39 +-- .../CustomUserControlViewManagerCS.cs | 5 +- .../AttributedViewManager.cs | 61 +++- .../Microsoft.ReactNative/ABIViewManager.cpp | 9 + vnext/Microsoft.ReactNative/IViewManager.idl | 1 + vnext/Microsoft.ReactNative/ReactSupport.cpp | 4 +- vnext/docs/NativeModules.md | 6 +- vnext/docs/ViewManagers.md | 308 +++++++++++++++++- 17 files changed, 495 insertions(+), 59 deletions(-) create mode 100644 change/react-native-windows-2019-11-06-16-45-50-vmcommands.json create mode 100644 packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCPP/DebugHelpers.cpp create mode 100644 packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCPP/DebugHelpers.h diff --git a/change/react-native-windows-2019-11-06-16-45-50-vmcommands.json b/change/react-native-windows-2019-11-06-16-45-50-vmcommands.json new file mode 100644 index 00000000000..163e88d4f8c --- /dev/null +++ b/change/react-native-windows-2019-11-06-16-45-50-vmcommands.json @@ -0,0 +1,8 @@ +{ + "type": "prerelease", + "comment": "ViewManager Command Updates * Added command to CustomUserControlViewManagerCPP, #3600 * Added support for simpler C# view manager commands signatures * Added support for object properties for view managers, #3613 * Added documentation for C++ view manager * Added documentation for ViewManager commands, #3599", + "packageName": "react-native-windows", + "email": "jthysell@microsoft.com", + "commit": "529a95bf145b1f25511874776724082ab8032caa", + "date": "2019-11-07T00:45:50.666Z" +} \ No newline at end of file diff --git a/packages/microsoft-reactnative-sampleapps/index.windows.js b/packages/microsoft-reactnative-sampleapps/index.windows.js index 3a4e872e21b..a3dfb6722f7 100644 --- a/packages/microsoft-reactnative-sampleapps/index.windows.js +++ b/packages/microsoft-reactnative-sampleapps/index.windows.js @@ -36,11 +36,6 @@ var getCallback = function(prefix) { }; class SampleApp extends Component { - constructor(props) { - super(props); - this._CustomUserControlCSRef = React.createRef(); - } - componentDidMount() { this._TimedEventCSSub = SampleModuleCSEmitter.addListener('TimedEventCS', getCallback('SampleModuleCS.TimedEventCS() => ')); this._TimedEventCPPSub = SampleModuleCPPEmitter.addListener('TimedEventCPP', getCallback('SampleModuleCPP.TimedEventCPP() => ')); @@ -130,11 +125,26 @@ class SampleApp extends Component { onPressCustomUserControlCS() { log('SampleApp.onPressCustomUserControlCS()'); + var strArg = 'Hello World!'; + if (this._CustomUserControlCSRef) { const tag = findNodeHandle(this._CustomUserControlCSRef); - log(`tag: ${tag}`); - UIManager.dispatchViewManagerCommand(tag, UIManager.CustomUserControlCS.Commands.CustomCommand, ['Hello World!']); + log(`UIManager.dispatchViewManagerCommand(${tag}, CustomUserControlCS.CustomCommand, "${strArg}")`); + UIManager.dispatchViewManagerCommand(tag, UIManager.getViewManagerConfig('CustomUserControlCS').Commands.CustomCommand, strArg); + } + } + + onPressCustomUserControlCPP() { + log('SampleApp.onPressCustomUserControlCPP()'); + + var strArg = 'Hello World!'; + + if (this._CustomUserControlCPPRef) + { + const tag = findNodeHandle(this._CustomUserControlCPPRef); + log(`UIManager.dispatchViewManagerCommand(${tag}, CustomUserControlCPP.CustomCommand, "${strArg}")`); + UIManager.dispatchViewManagerCommand(tag, UIManager.getViewManagerConfig('CustomUserControlCPP').Commands.CustomCommand, strArg); } } @@ -154,7 +164,9 @@ class SampleApp extends Component { { this._CustomUserControlCSRef = ref; }} />