Remove react::uwp namespace (#7715)
* Remove macro that was used for react::uwp namespace replacement * Change files * Rename the rest of the react::uwp namespaces * Fix def file
This commit is contained in:
Родитель
05ed6a755f
Коммит
fe6d6a12c1
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "prerelease",
|
||||
"comment": "Rename remaining react::uwp namespaces to Microsoft::ReactNative",
|
||||
"packageName": "react-native-windows",
|
||||
"email": "30809111+acoates-ms@users.noreply.github.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
|
@ -165,6 +165,7 @@ module.exports = {
|
|||
new RegExp(
|
||||
`${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
|
||||
),
|
||||
/.*.tlog/,
|
||||
]),
|
||||
resolveRequest: devResolveRequest,
|
||||
},
|
||||
|
|
|
@ -294,7 +294,7 @@ struct WindowData {
|
|||
|
||||
// auto cmbEngines = GetDlgItem(hwnd, IDC_JSENGINE);
|
||||
// int itemIndex = (int)SendMessageW(cmbEngines, (UINT)CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
|
||||
// self->m_jsEngine = static_cast<react::uwp::JSIEngine>(itemIndex);
|
||||
// self->m_jsEngine = static_cast<Microsoft::ReactNative::JSIEngine>(itemIndex);
|
||||
}
|
||||
[[fallthrough]];
|
||||
case IDCANCEL:
|
||||
|
|
|
@ -67,7 +67,7 @@ EXPORTS
|
|||
??0WebSocketModule@React@Microsoft@@QEAA@XZ
|
||||
??0NetworkingModule@React@Microsoft@@QEAA@XZ
|
||||
?CreateAsyncStorageModule@react@facebook@@YA?AV?$unique_ptr@VCxxModule@module@xplat@facebook@@U?$default_delete@VCxxModule@module@xplat@facebook@@@std@@@std@@PEB_W@Z
|
||||
?MakeJSQueueThread@uwp@react@@YA?AV?$shared_ptr@VMessageQueueThread@react@facebook@@@std@@XZ
|
||||
?MakeJSQueueThread@ReactNative@Microsoft@@YA?AV?$shared_ptr@VMessageQueueThread@react@facebook@@@std@@XZ
|
||||
?Hash128@SpookyHashV2@hash@folly@@SAXPEBX_KPEA_K2@Z
|
||||
??1Instance@react@facebook@@QEAA@XZ
|
||||
?invokeAsync@JSCallInvoker@Instance@react@facebook@@UEAAX$$QEAV?$function@$$A6AXXZ@std@@@Z
|
||||
|
|
|
@ -66,7 +66,7 @@ EXPORTS
|
|||
?CreateAsyncStorageModule@react@facebook@@YG?AV?$unique_ptr@VCxxModule@module@xplat@facebook@@U?$default_delete@VCxxModule@module@xplat@facebook@@@std@@@std@@PB_W@Z
|
||||
?Make@IHttpResource@React@Microsoft@@SG?AV?$unique_ptr@UIHttpResource@React@Microsoft@@U?$default_delete@UIHttpResource@React@Microsoft@@@std@@@std@@XZ
|
||||
??0NetworkingModule@React@Microsoft@@QAE@XZ
|
||||
?MakeJSQueueThread@uwp@react@@YG?AV?$shared_ptr@VMessageQueueThread@react@facebook@@@std@@XZ
|
||||
?MakeJSQueueThread@ReactNative@Microsoft@@YG?AV?$shared_ptr@VMessageQueueThread@react@facebook@@@std@@XZ
|
||||
?Hash128@SpookyHashV2@hash@folly@@SGXPBXIPA_K1@Z
|
||||
?assertionFailure@detail@folly@@YGXPBD00I0H@Z
|
||||
??1Instance@react@facebook@@QAE@XZ
|
||||
|
|
|
@ -41,8 +41,8 @@ shared_ptr<ITestInstance> TestRunner::GetInstance(
|
|||
string &&jsBundleFile,
|
||||
vector<tuple<string, CxxModule::Provider>> &&cxxModules,
|
||||
shared_ptr<DevSettings> devSettings) noexcept {
|
||||
auto nativeQueue = react::uwp::MakeJSQueueThread();
|
||||
auto jsQueue = react::uwp::MakeJSQueueThread();
|
||||
auto nativeQueue = Microsoft::ReactNative::MakeJSQueueThread();
|
||||
auto jsQueue = Microsoft::ReactNative::MakeJSQueueThread();
|
||||
|
||||
vector<tuple<string, CxxModule::Provider, shared_ptr<MessageQueueThread>>> extraModules{
|
||||
{"AsyncLocalStorage",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <CppUnitTest.h>
|
||||
#include <Executors/WebSocketJSExecutor.h>
|
||||
|
||||
using namespace react::uwp;
|
||||
using namespace Microsoft::ReactNative;
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
|
||||
namespace Microsoft::React::Test {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// Shared
|
||||
#include <CreateModules.h>
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -45,7 +45,7 @@ std::vector<facebook::react::NativeModuleDescription> GetCoreModules(
|
|||
const std::shared_ptr<facebook::react::MessageQueueThread> &batchingUIMessageQueue,
|
||||
const std::shared_ptr<facebook::react::MessageQueueThread>
|
||||
&jsMessageQueue, // JS engine thread (what we use for external modules)
|
||||
std::shared_ptr<react::uwp::AppTheme> &&appTheme,
|
||||
std::shared_ptr<AppTheme> &&appTheme,
|
||||
Mso::CntPtr<AppearanceChangeListener> &&appearanceListener,
|
||||
Mso::CntPtr<Mso::React::IReactContext> &&context) noexcept {
|
||||
std::vector<facebook::react::NativeModuleDescription> modules;
|
||||
|
@ -74,10 +74,8 @@ std::vector<facebook::react::NativeModuleDescription> GetCoreModules(
|
|||
batchingUIMessageQueue);
|
||||
|
||||
modules.emplace_back(
|
||||
react::uwp::AppThemeModule::Name,
|
||||
[appTheme = std::move(appTheme)]() mutable {
|
||||
return std::make_unique<react::uwp::AppThemeModule>(std::move(appTheme));
|
||||
},
|
||||
AppThemeModule::Name,
|
||||
[appTheme = std::move(appTheme)]() mutable { return std::make_unique<AppThemeModule>(std::move(appTheme)); },
|
||||
batchingUIMessageQueue);
|
||||
|
||||
modules.emplace_back(
|
||||
|
@ -108,4 +106,4 @@ std::vector<facebook::react::NativeModuleDescription> GetCoreModules(
|
|||
return modules;
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -18,17 +18,17 @@ class IUIManager;
|
|||
class MessageQueueThread;
|
||||
} // namespace facebook::react
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
class DeviceInfo;
|
||||
struct DeviceInfo;
|
||||
struct IReactInstance;
|
||||
struct ViewManagerProvider;
|
||||
|
||||
std::vector<facebook::react::NativeModuleDescription> GetCoreModules(
|
||||
const std::shared_ptr<facebook::react::MessageQueueThread> &batchingUIMessageQueue,
|
||||
const std::shared_ptr<facebook::react::MessageQueueThread> &jsMessageQueue,
|
||||
std::shared_ptr<react::uwp::AppTheme> &&appTheme,
|
||||
std::shared_ptr<AppTheme> &&appTheme,
|
||||
Mso::CntPtr<AppearanceChangeListener> &&appearanceListener,
|
||||
Mso::CntPtr<Mso::React::IReactContext> &&context) noexcept;
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -223,7 +223,7 @@ void FabricUIManager::startSurface(
|
|||
facebook::react::SurfaceId surfaceId,
|
||||
const std::string &moduleName,
|
||||
const folly::dynamic &initialProps) noexcept {
|
||||
auto xamlRootView = static_cast<::react::uwp::IXamlRootView *>(rootview);
|
||||
auto xamlRootView = static_cast<IXamlRootView *>(rootview);
|
||||
auto rootFE = xamlRootView->GetXamlView().as<xaml::FrameworkElement>();
|
||||
|
||||
m_surfaceRegistry.insert({surfaceId, xamlRootView->GetXamlView()});
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
namespace Microsoft::ReactNative {
|
||||
|
||||
ImageComponentView::ImageComponentView(winrt::Microsoft::ReactNative::ReactContext const &reactContext)
|
||||
: m_context(reactContext), m_element(::react::uwp::ReactImage::Create()) {
|
||||
: m_context(reactContext), m_element(ReactImage::Create()) {
|
||||
static auto const defaultProps = std::make_shared<facebook::react::ImageProps const>();
|
||||
m_props = defaultProps;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ void ImageComponentView::updateProps(
|
|||
if (newImageProps.sources.empty()) {
|
||||
// TODO clear image
|
||||
} else {
|
||||
::react::uwp::ReactImageSource ris;
|
||||
ReactImageSource ris;
|
||||
ris.uri = newImageProps.sources[0].uri;
|
||||
ris.width = newImageProps.sources[0].size.width;
|
||||
ris.height = newImageProps.sources[0].size.height;
|
||||
|
|
|
@ -40,7 +40,7 @@ struct ImageComponentView : BaseComponentView {
|
|||
private:
|
||||
facebook::react::SharedViewProps m_props;
|
||||
facebook::react::LayoutMetrics m_layoutMetrics;
|
||||
winrt::com_ptr<::react::uwp::ReactImage> m_element;
|
||||
winrt::com_ptr<ReactImage> m_element;
|
||||
winrt::Microsoft::ReactNative::ReactContext m_context;
|
||||
};
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ void ParagraphComponentView::updateProps(
|
|||
|
||||
if (oldViewProps.textAttributes.foregroundColor != newViewProps.textAttributes.foregroundColor) {
|
||||
if (newViewProps.textAttributes.foregroundColor)
|
||||
m_element.Foreground(::react::uwp::SolidColorBrushFrom(newViewProps.textAttributes.foregroundColor));
|
||||
m_element.Foreground(SolidColorBrushFrom(newViewProps.textAttributes.foregroundColor));
|
||||
else
|
||||
m_element.ClearValue(::xaml::Controls::TextBlock::ForegroundProperty());
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ void ScrollViewComponentView::updateProps(
|
|||
auto color = *newViewProps.backgroundColor;
|
||||
|
||||
if (newViewProps.backgroundColor) {
|
||||
m_element.ViewBackground(::react::uwp::SolidColorBrushFrom(newViewProps.backgroundColor));
|
||||
m_element.ViewBackground(SolidColorBrushFrom(newViewProps.backgroundColor));
|
||||
} else {
|
||||
m_element.ClearValue(winrt::Microsoft::ReactNative::ViewPanel::ViewBackgroundProperty());
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ void ScrollViewComponentView::updateProps(
|
|||
|
||||
if (oldViewProps.borderColors != newViewProps.borderColors) {
|
||||
if (newViewProps.borderColors.all) {
|
||||
m_element.BorderBrush(::react::uwp::SolidColorBrushFrom(*newViewProps.borderColors.all));
|
||||
m_element.BorderBrush(SolidColorBrushFrom(*newViewProps.borderColors.all));
|
||||
} else {
|
||||
m_element.ClearValue(winrt::Microsoft::ReactNative::ViewPanel::BorderBrushProperty());
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ void TextComponentView::updateProps(
|
|||
auto color = *newViewProps.backgroundColor;
|
||||
|
||||
if (newViewProps.backgroundColor) {
|
||||
m_element.ViewBackground(::react::uwp::SolidColorBrushFrom(newViewProps.backgroundColor));
|
||||
m_element.ViewBackground(SolidColorBrushFrom(newViewProps.backgroundColor));
|
||||
} else {
|
||||
m_element.ClearValue(winrt::Microsoft::ReactNative::ViewPanel::ViewBackgroundProperty());
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ void TextComponentView::updateProps(
|
|||
|
||||
if (oldViewProps.borderColors != newViewProps.borderColors) {
|
||||
if (newViewProps.borderColors.all) {
|
||||
m_element.BorderBrush(::react::uwp::SolidColorBrushFrom(*newViewProps.borderColors.all));
|
||||
m_element.BorderBrush(SolidColorBrushFrom(*newViewProps.borderColors.all));
|
||||
} else {
|
||||
m_element.ClearValue(winrt::Microsoft::ReactNative::ViewPanel::BorderBrushProperty());
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ void ViewComponentView::updateProps(
|
|||
auto color = *newViewProps.backgroundColor;
|
||||
|
||||
if (newViewProps.backgroundColor) {
|
||||
m_element.ViewBackground(::react::uwp::SolidColorBrushFrom(newViewProps.backgroundColor));
|
||||
m_element.ViewBackground(SolidColorBrushFrom(newViewProps.backgroundColor));
|
||||
} else {
|
||||
m_element.ClearValue(winrt::Microsoft::ReactNative::ViewPanel::ViewBackgroundProperty());
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ void ViewComponentView::updateProps(
|
|||
|
||||
if (oldViewProps.borderColors != newViewProps.borderColors) {
|
||||
if (newViewProps.borderColors.all) {
|
||||
m_element.BorderBrush(::react::uwp::SolidColorBrushFrom(*newViewProps.borderColors.all));
|
||||
m_element.BorderBrush(SolidColorBrushFrom(*newViewProps.borderColors.all));
|
||||
} else {
|
||||
m_element.ClearValue(winrt::Microsoft::ReactNative::ViewPanel::BorderBrushProperty());
|
||||
}
|
||||
|
|
|
@ -59,8 +59,8 @@ void GlyphShadowNode::updateProperties(winrt::Microsoft::ReactNative::JSValueObj
|
|||
const auto &propertyValue = pair.second;
|
||||
|
||||
if (propertyName == "color") {
|
||||
if (react::uwp::IsValidColorValue(propertyValue))
|
||||
glyphs.Fill(react::uwp::BrushFrom(propertyValue));
|
||||
if (IsValidColorValue(propertyValue))
|
||||
glyphs.Fill(BrushFrom(propertyValue));
|
||||
#ifdef DEBUG
|
||||
else if (propertyValue.IsNull()) {
|
||||
// Log error, must have a color
|
||||
|
@ -69,12 +69,12 @@ void GlyphShadowNode::updateProperties(winrt::Microsoft::ReactNative::JSValueObj
|
|||
#endif
|
||||
} else if (propertyName == "fontUri") {
|
||||
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
||||
auto uri = winrt::Uri(react::uwp::asHstring(propertyValue));
|
||||
auto uri = winrt::Uri(asHstring(propertyValue));
|
||||
glyphs.FontUri(uri);
|
||||
}
|
||||
} else if (propertyName == "glyph") {
|
||||
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {
|
||||
glyphs.Indices(react::uwp::asHstring(propertyValue));
|
||||
glyphs.Indices(asHstring(propertyValue));
|
||||
}
|
||||
} else if (propertyName == "colorEnabled") {
|
||||
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Boolean)
|
||||
|
|
|
@ -131,7 +131,6 @@
|
|||
WIN32=0;
|
||||
WINRT=1;
|
||||
_HAS_AUTO_PTR_ETC;
|
||||
PROJECT_ROOT_NAMESPACE=Microsoft::ReactNative;
|
||||
%(PreprocessorDefinitions)
|
||||
</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(RNW_FASTBUILD)' == 'true'">RNW_FASTBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
@ -166,8 +165,7 @@
|
|||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<Midl>
|
||||
<!-- Custom XAML types must be in the project namespace to be usable by XAML -->
|
||||
<PreprocessorDefinitions>PROJECT_ROOT_NAMESPACE=$(RootNamespace);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
|
|
|
@ -45,7 +45,7 @@ void AccessibilityInfo::announceForAccessibility(std::string announcement) noexc
|
|||
// So we need to find something to raise the notification event from.
|
||||
xaml::UIElement element{nullptr};
|
||||
|
||||
if (react::uwp::IsXamlIsland()) {
|
||||
if (IsXamlIsland()) {
|
||||
if (auto accessibleRoot =
|
||||
winrt::Microsoft::ReactNative::XamlUIService::GetAccessibleRoot(context.Properties().Handle())) {
|
||||
element = accessibleRoot;
|
||||
|
|
|
@ -26,7 +26,7 @@ void Alert::showAlert(ShowAlertArgs const &args, std::function<void(std::string)
|
|||
dialog.SecondaryButtonText(Microsoft::Common::Unicode::Utf8ToUtf16(args.buttonNegative));
|
||||
dialog.CloseButtonText(Microsoft::Common::Unicode::Utf8ToUtf16(args.buttonNeutral));
|
||||
|
||||
if (react::uwp::Is19H1OrHigher()) {
|
||||
if (Is19H1OrHigher()) {
|
||||
// XamlRoot added in 19H1
|
||||
if (const auto xamlRoot = React::XamlUIService::GetXamlRoot(strongThis->m_context.Properties().Handle())) {
|
||||
dialog.XamlRoot(xamlRoot);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "AdditionAnimatedNode.h"
|
||||
#include "NativeAnimatedNodeManager.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
AdditionAnimatedNode::AdditionAnimatedNode(
|
||||
int64_t tag,
|
||||
const folly::dynamic &config,
|
||||
|
@ -32,4 +32,4 @@ AdditionAnimatedNode::AdditionAnimatedNode(
|
|||
return anim;
|
||||
}());
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <folly/dynamic.h>
|
||||
#include "ValueAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class AdditionAnimatedNode final : public ValueAnimatedNode {
|
||||
public:
|
||||
AdditionAnimatedNode(
|
||||
|
@ -16,4 +16,4 @@ class AdditionAnimatedNode final : public ValueAnimatedNode {
|
|||
private:
|
||||
std::unordered_set<int64_t> m_inputNodes{};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "AnimatedNode.h"
|
||||
#include "NativeAnimatedNodeManager.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
AnimatedNode::AnimatedNode(int64_t tag, const std::shared_ptr<NativeAnimatedNodeManager> &manager)
|
||||
: m_tag(tag), m_manager(manager) {}
|
||||
|
@ -36,4 +36,4 @@ AnimatedNode *AnimatedNode::GetChildNode(int64_t tag) {
|
|||
|
||||
return static_cast<AnimatedNode *>(nullptr);
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class NativeAnimatedNodeManager;
|
||||
class AnimatedNode {
|
||||
public:
|
||||
|
@ -27,4 +27,4 @@ class AnimatedNode {
|
|||
const std::weak_ptr<NativeAnimatedNodeManager> m_manager;
|
||||
std::vector<int64_t> m_children{};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <UI.Composition.h>
|
||||
#include "AnimationDriver.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
AnimationDriver::AnimationDriver(
|
||||
int64_t id,
|
||||
|
@ -90,4 +90,4 @@ ValueAnimatedNode *AnimationDriver::GetAnimatedValue() {
|
|||
}
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "NativeAnimatedNodeManager.h"
|
||||
#include "ValueAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
typedef std::function<void(std::vector<folly::dynamic>)> Callback;
|
||||
|
||||
class ValueAnimatedNode;
|
||||
|
@ -73,4 +73,4 @@ class AnimationDriver {
|
|||
// #22399779
|
||||
winrt::event_token m_scopedBatchCompletedToken{};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <math.h>
|
||||
#include "CalculatedAnimationDriver.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
std::tuple<comp::CompositionAnimation, comp::CompositionScopedBatch> CalculatedAnimationDriver::MakeAnimation(
|
||||
const folly::dynamic & /*config*/) {
|
||||
|
@ -54,4 +54,4 @@ std::tuple<comp::CompositionAnimation, comp::CompositionScopedBatch> CalculatedA
|
|||
return std::make_tuple(animation, scopedBatch);
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "AnimatedNode.h"
|
||||
#include "AnimationDriver.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class CalculatedAnimationDriver : public AnimationDriver {
|
||||
public:
|
||||
using AnimationDriver::AnimationDriver;
|
||||
|
@ -21,4 +21,4 @@ class CalculatedAnimationDriver : public AnimationDriver {
|
|||
virtual bool IsAnimationDone(double currentValue, double currentVelocity) = 0;
|
||||
double m_startValue{0};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <math.h>
|
||||
#include "DecayAnimationDriver.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
DecayAnimationDriver::DecayAnimationDriver(
|
||||
int64_t id,
|
||||
int64_t animatedValueTag,
|
||||
|
@ -43,4 +43,4 @@ double DecayAnimationDriver::ToValue() {
|
|||
return m_startValue + m_velocity / (1 - m_deceleration);
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "AnimatedNode.h"
|
||||
#include "CalculatedAnimationDriver.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class DecayAnimationDriver : public CalculatedAnimationDriver {
|
||||
public:
|
||||
DecayAnimationDriver(
|
||||
|
@ -33,4 +33,4 @@ class DecayAnimationDriver : public CalculatedAnimationDriver {
|
|||
static constexpr std::wstring_view s_decelerationParameterName{L"deceleration"};
|
||||
static constexpr std::wstring_view s_durationName{L"duration"};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "DiffClampAnimatedNode.h"
|
||||
#include "NativeAnimatedNodeManager.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
DiffClampAnimatedNode::DiffClampAnimatedNode(
|
||||
int64_t tag,
|
||||
const folly::dynamic &config,
|
||||
|
@ -27,4 +27,4 @@ DiffClampAnimatedNode::DiffClampAnimatedNode(
|
|||
return anim;
|
||||
}());
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <folly/dynamic.h>
|
||||
#include "ValueAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class DiffClampAnimatedNode final : public ValueAnimatedNode {
|
||||
public:
|
||||
DiffClampAnimatedNode(
|
||||
|
@ -25,4 +25,4 @@ class DiffClampAnimatedNode final : public ValueAnimatedNode {
|
|||
static constexpr std::wstring_view s_minParameterName{L"min"};
|
||||
static constexpr std::wstring_view s_maxParameterName{L"max"};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "DivisionAnimatedNode.h"
|
||||
#include "NativeAnimatedNodeManager.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
DivisionAnimatedNode::DivisionAnimatedNode(
|
||||
int64_t tag,
|
||||
const folly::dynamic &config,
|
||||
|
@ -37,4 +37,4 @@ DivisionAnimatedNode::DivisionAnimatedNode(
|
|||
return anim;
|
||||
}());
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <folly/dynamic.h>
|
||||
#include "ValueAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class DivisionAnimatedNode final : public ValueAnimatedNode {
|
||||
public:
|
||||
DivisionAnimatedNode(
|
||||
|
@ -21,4 +21,4 @@ class DivisionAnimatedNode final : public ValueAnimatedNode {
|
|||
|
||||
static constexpr std::wstring_view s_baseName{L"base"};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "EventAnimationDriver.h"
|
||||
#include "NativeAnimatedNodeManager.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
EventAnimationDriver::EventAnimationDriver(
|
||||
const folly::dynamic &eventPath,
|
||||
int64_t animatedValueTag,
|
||||
|
@ -24,4 +24,4 @@ ValueAnimatedNode *EventAnimationDriver::AnimatedValue() {
|
|||
return static_cast<ValueAnimatedNode *>(nullptr);
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "AnimatedNode.h"
|
||||
#include "ValueAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class ValueAnimatedNode;
|
||||
class EventAnimationDriver {
|
||||
public:
|
||||
|
@ -21,4 +21,4 @@ class EventAnimationDriver {
|
|||
int64_t m_animatedValueTag{};
|
||||
std::weak_ptr<NativeAnimatedNodeManager> m_manager{};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "FrameAnimationDriver.h"
|
||||
#include "Utils/Helpers.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
FrameAnimationDriver::FrameAnimationDriver(
|
||||
int64_t id,
|
||||
int64_t animatedValueTag,
|
||||
|
@ -26,8 +26,7 @@ std::tuple<comp::CompositionAnimation, comp::CompositionScopedBatch> FrameAnimat
|
|||
const auto compositor = Microsoft::ReactNative::GetCompositor();
|
||||
return std::make_tuple(
|
||||
compositor.CreateScopedBatch(
|
||||
react::uwp::IsRS5OrHigher() ? comp::CompositionBatchTypes::AllAnimations
|
||||
: comp::CompositionBatchTypes::Animation),
|
||||
IsRS5OrHigher() ? comp::CompositionBatchTypes::AllAnimations : comp::CompositionBatchTypes::Animation),
|
||||
compositor.CreateScalarKeyFrameAnimation());
|
||||
}();
|
||||
|
||||
|
@ -58,4 +57,4 @@ double FrameAnimationDriver::ToValue() {
|
|||
return m_toValue;
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "AnimatedNode.h"
|
||||
#include "AnimationDriver.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class FrameAnimationDriver : public AnimationDriver {
|
||||
public:
|
||||
FrameAnimationDriver(
|
||||
|
@ -29,4 +29,4 @@ class FrameAnimationDriver : public AnimationDriver {
|
|||
std::vector<double> m_frames{};
|
||||
double m_toValue{0};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "InterpolationAnimatedNode.h"
|
||||
#include "NativeAnimatedNodeManager.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
InterpolationAnimatedNode::InterpolationAnimatedNode(
|
||||
int64_t tag,
|
||||
const folly::dynamic &config,
|
||||
|
@ -166,4 +166,4 @@ winrt::hstring InterpolationAnimatedNode::GetRightExpression(
|
|||
}
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <folly/dynamic.h>
|
||||
#include "ValueAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
class InterpolationAnimatedNode final : public ValueAnimatedNode {
|
||||
public:
|
||||
|
@ -55,4 +55,4 @@ class InterpolationAnimatedNode final : public ValueAnimatedNode {
|
|||
static constexpr std::wstring_view s_inputName{L"i"};
|
||||
static constexpr std::wstring_view s_outputName{L"o"};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "ModulusAnimatedNode.h"
|
||||
#include "NativeAnimatedNodeManager.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
ModulusAnimatedNode::ModulusAnimatedNode(
|
||||
int64_t tag,
|
||||
const folly::dynamic &config,
|
||||
|
@ -25,4 +25,4 @@ ModulusAnimatedNode::ModulusAnimatedNode(
|
|||
return anim;
|
||||
}());
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <folly/dynamic.h>
|
||||
#include "ValueAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class ModulusAnimatedNode final : public ValueAnimatedNode {
|
||||
public:
|
||||
ModulusAnimatedNode(
|
||||
|
@ -22,4 +22,4 @@ class ModulusAnimatedNode final : public ValueAnimatedNode {
|
|||
static constexpr std::wstring_view s_inputParameterName{L"input"};
|
||||
static constexpr std::wstring_view s_modName{L"mod"};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "MultiplicationAnimatedNode.h"
|
||||
#include "NativeAnimatedNodeManager.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
MultiplicationAnimatedNode::MultiplicationAnimatedNode(
|
||||
int64_t tag,
|
||||
const folly::dynamic &config,
|
||||
|
@ -31,4 +31,4 @@ MultiplicationAnimatedNode::MultiplicationAnimatedNode(
|
|||
return anim;
|
||||
}());
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <folly/dynamic.h>
|
||||
#include "ValueAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class MultiplicationAnimatedNode final : public ValueAnimatedNode {
|
||||
public:
|
||||
MultiplicationAnimatedNode(
|
||||
|
@ -16,4 +16,4 @@ class MultiplicationAnimatedNode final : public ValueAnimatedNode {
|
|||
private:
|
||||
std::unordered_set<int64_t> m_inputNodes{};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <cxxreact/Instance.h>
|
||||
#include <cxxreact/JsArgumentHelpers.h>
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
const char *NativeAnimatedModule::name{"NativeAnimatedModule"};
|
||||
|
||||
NativeAnimatedModule::NativeAnimatedModule(Mso::CntPtr<Mso::React::IReactContext> &&context)
|
||||
|
@ -235,4 +235,4 @@ void NativeAnimatedModule::StartListeningToAnimatedNodeValue(int64_t /*tag*/) {
|
|||
void NativeAnimatedModule::StopListeningToAnimatedNodeValue(int64_t /*tag*/) {
|
||||
// NotImplemented
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
/// from JS and the main class that coordinates all the action:
|
||||
/// <see cref="NativeAnimatedNodeManager"/>.
|
||||
/// </remarks>
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class NativeAnimatedModule final : public facebook::xplat::module::CxxModule {
|
||||
public:
|
||||
NativeAnimatedModule(Mso::CntPtr<Mso::React::IReactContext> &&context);
|
||||
|
@ -95,4 +95,4 @@ class NativeAnimatedModule final : public facebook::xplat::module::CxxModule {
|
|||
std::shared_ptr<NativeAnimatedNodeManager> m_nodesManager{};
|
||||
Mso::CntPtr<Mso::React::IReactContext> m_context;
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <Modules/PaperUIManagerModule.h>
|
||||
#include <Windows.Foundation.h>
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
void NativeAnimatedNodeManager::CreateAnimatedNode(
|
||||
int64_t tag,
|
||||
const folly::dynamic &config,
|
||||
|
@ -406,4 +406,4 @@ TrackingAnimatedNode *NativeAnimatedNodeManager::GetTrackingAnimatedNode(int64_t
|
|||
void NativeAnimatedNodeManager::RemoveActiveAnimation(int64_t tag) {
|
||||
m_activeAnimations.erase(tag);
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "TransformAnimatedNode.h"
|
||||
#include "ValueAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
/// <summary>
|
||||
/// This is the main class that coordinates how native animated JS
|
||||
/// implementation drives UI changes.
|
||||
|
@ -106,4 +106,4 @@ class NativeAnimatedNodeManager {
|
|||
static constexpr std::string_view s_framesName{"frames"};
|
||||
static constexpr std::string_view s_dynamicToValuesName{"dynamicToValues"};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "PropsAnimatedNode.h"
|
||||
#include "StyleAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
PropsAnimatedNode::PropsAnimatedNode(
|
||||
int64_t tag,
|
||||
const folly::dynamic &config,
|
||||
|
@ -279,4 +279,4 @@ xaml::UIElement PropsAnimatedNode::GetUIElement() {
|
|||
}
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Microsoft::ReactNative {
|
|||
struct ShadowNodeBase;
|
||||
}
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class PropsAnimatedNode final : public AnimatedNode {
|
||||
public:
|
||||
PropsAnimatedNode(
|
||||
|
@ -50,4 +50,4 @@ class PropsAnimatedNode final : public AnimatedNode {
|
|||
|
||||
static constexpr int64_t s_connectedViewTagUnset{-1};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <math.h>
|
||||
#include "SpringAnimationDriver.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
SpringAnimationDriver::SpringAnimationDriver(
|
||||
int64_t id,
|
||||
int64_t animatedValueTag,
|
||||
|
@ -85,4 +85,4 @@ double SpringAnimationDriver::ToValue() {
|
|||
return m_endValue;
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "AnimatedNode.h"
|
||||
#include "CalculatedAnimationDriver.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class SpringAnimationDriver : public CalculatedAnimationDriver {
|
||||
public:
|
||||
SpringAnimationDriver(
|
||||
|
@ -48,5 +48,5 @@ class SpringAnimationDriver : public CalculatedAnimationDriver {
|
|||
static constexpr std::string_view s_displacementFromRestThresholdParameterName{"restDisplacementThreshold"};
|
||||
static constexpr std::string_view s_overshootClampingEnabledParameterName{"overshootClamping"};
|
||||
static constexpr std::string_view s_iterationsParameterName{"iterations"};
|
||||
}; // namespace uwp
|
||||
} // namespace react::uwp
|
||||
};
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "NativeAnimatedNodeManager.h"
|
||||
#include "StyleAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
StyleAnimatedNode::StyleAnimatedNode(
|
||||
int64_t tag,
|
||||
const folly::dynamic &config,
|
||||
|
@ -33,4 +33,4 @@ std::unordered_map<FacadeType, int64_t> StyleAnimatedNode::GetMapping() {
|
|||
}
|
||||
return mapping;
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "AnimatedNode.h"
|
||||
#include "FacadeType.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class StyleAnimatedNode final : public AnimatedNode {
|
||||
public:
|
||||
StyleAnimatedNode(
|
||||
|
@ -22,4 +22,4 @@ class StyleAnimatedNode final : public AnimatedNode {
|
|||
|
||||
static constexpr std::string_view s_styleName{"style"};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "NativeAnimatedNodeManager.h"
|
||||
#include "SubtractionAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
SubtractionAnimatedNode::SubtractionAnimatedNode(
|
||||
int64_t tag,
|
||||
const folly::dynamic &config,
|
||||
|
@ -37,4 +37,4 @@ SubtractionAnimatedNode::SubtractionAnimatedNode(
|
|||
return anim;
|
||||
}());
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <folly/dynamic.h>
|
||||
#include "ValueAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class SubtractionAnimatedNode final : public ValueAnimatedNode {
|
||||
public:
|
||||
SubtractionAnimatedNode(
|
||||
|
@ -21,4 +21,4 @@ class SubtractionAnimatedNode final : public ValueAnimatedNode {
|
|||
|
||||
static constexpr std::wstring_view s_baseName{L"base"};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "NativeAnimatedNodeManager.h"
|
||||
#include "TrackingAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
TrackingAnimatedNode::TrackingAnimatedNode(
|
||||
int64_t tag,
|
||||
const folly::dynamic &config,
|
||||
|
@ -35,4 +35,4 @@ void TrackingAnimatedNode::StartAnimation() {
|
|||
}
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <folly/dynamic.h>
|
||||
#include "AnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class TrackingAnimatedNode final : public AnimatedNode {
|
||||
public:
|
||||
TrackingAnimatedNode(
|
||||
|
@ -28,5 +28,5 @@ class TrackingAnimatedNode final : public AnimatedNode {
|
|||
static constexpr std::string_view s_valueIdName{"value"};
|
||||
static constexpr std::string_view s_animationConfigName{"animationConfig"};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
#pragma once
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "FacadeType.h"
|
||||
#include "TransformAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
TransformAnimatedNode::TransformAnimatedNode(
|
||||
int64_t tag,
|
||||
const folly::dynamic &config,
|
||||
|
@ -33,4 +33,4 @@ std::unordered_map<FacadeType, int64_t> TransformAnimatedNode::GetMapping() {
|
|||
}
|
||||
return mapping;
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "AnimatedNode.h"
|
||||
#include "FacadeType.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
struct TransformConfig {
|
||||
public:
|
||||
std::string property;
|
||||
|
@ -34,4 +34,4 @@ class TransformAnimatedNode final : public AnimatedNode {
|
|||
static constexpr std::string_view s_nodeTagName{"nodeTag"};
|
||||
static constexpr std::string_view s_valueName{"value"};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "NativeAnimatedNodeManager.h"
|
||||
#include "ValueAnimatedNode.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
ValueAnimatedNode::ValueAnimatedNode(
|
||||
int64_t tag,
|
||||
const folly::dynamic &config,
|
||||
|
@ -124,4 +124,4 @@ void ValueAnimatedNode::UpdateTrackingNodes() {
|
|||
}
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace winrt {
|
|||
using namespace comp;
|
||||
}
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class ValueAnimatedNode : public AnimatedNode {
|
||||
public:
|
||||
ValueAnimatedNode(
|
||||
|
@ -53,4 +53,4 @@ class ValueAnimatedNode : public AnimatedNode {
|
|||
std::unordered_set<int64_t> m_activeAnimations{};
|
||||
std::unordered_set<int64_t> m_activeTrackingNodes{};
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -19,7 +19,7 @@ void AppState::Initialize(winrt::Microsoft::ReactNative::ReactContext const &rea
|
|||
dispatcher.Post([this]() {
|
||||
auto currentApp = xaml::TryGetCurrentApplication();
|
||||
|
||||
if (!react::uwp::IsWinUI3Island() && currentApp != nullptr) {
|
||||
if (!IsWinUI3Island() && currentApp != nullptr) {
|
||||
m_enteredBackgroundRevoker = currentApp.EnteredBackground(
|
||||
winrt::auto_revoke,
|
||||
[weakThis = weak_from_this()](
|
||||
|
@ -40,7 +40,7 @@ void AppState::Initialize(winrt::Microsoft::ReactNative::ReactContext const &rea
|
|||
}
|
||||
});
|
||||
} else {
|
||||
assert(react::uwp::IsXamlIsland());
|
||||
assert(IsXamlIsland());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ using namespace Windows::UI::ViewManagement;
|
|||
|
||||
using namespace winrt::Microsoft::ReactNative;
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
//
|
||||
// AppTheme
|
||||
|
@ -41,7 +41,7 @@ AppTheme::AppTheme(
|
|||
m_isHighContrast = getIsHighContrast();
|
||||
m_highContrastColors = getHighContrastColors();
|
||||
|
||||
if (react::uwp::IsWinUI3Island()) {
|
||||
if (IsWinUI3Island()) {
|
||||
m_wmSubscription = SubscribeToWindowMessage(
|
||||
ReactNotificationService(m_context->Notifications()), WM_THEMECHANGED, [this](const auto &, const auto &) {
|
||||
NotifyHighContrastChanged();
|
||||
|
@ -106,4 +106,4 @@ auto AppThemeModule::getMethods() -> std::vector<facebook::xplat::module::CxxMod
|
|||
return {};
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <cxxreact/MessageQueueThread.h>
|
||||
#include <winrt/Windows.UI.ViewManagement.h>
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
class AppTheme : public std::enable_shared_from_this<AppTheme> {
|
||||
public:
|
||||
|
@ -53,4 +53,4 @@ class AppThemeModule : public facebook::xplat::module::CxxModule {
|
|||
std::shared_ptr<AppTheme> m_appTheme;
|
||||
};
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -12,7 +12,7 @@ using UISettings = winrt::Windows::UI::ViewManagement::UISettings;
|
|||
|
||||
using Method = facebook::xplat::module::CxxModule::Method;
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
AppearanceChangeListener::AppearanceChangeListener(
|
||||
const Mso::React::IReactContext &context,
|
||||
|
@ -65,4 +65,4 @@ std::vector<Method> AppearanceModule::getMethods() {
|
|||
"getColorScheme", [this](folly::dynamic /*args*/) { return m_changeListener->GetColorScheme(); }, SyncTag)};
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include <React.h>
|
||||
#include "IReactInstance.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
// Listens for the current theme on the UI thread, storing the most recent. Will emit JS events on Appearance change.
|
||||
class AppearanceChangeListener final : public Mso::ActiveObject<> {
|
||||
|
@ -46,4 +46,4 @@ class AppearanceModule final : public facebook::xplat::module::CxxModule {
|
|||
Mso::CntPtr<AppearanceChangeListener> m_changeListener;
|
||||
};
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -29,7 +29,7 @@ std::shared_ptr<IWebSocketResource> IWebSocketResource::Make(std::string &&urlSt
|
|||
std::unique_ptr<facebook::xplat::module::CxxModule> CreateWebSocketModule(
|
||||
Mso::CntPtr<Mso::React::IReactContext> &&context) noexcept {
|
||||
if (context && QuirkSettings::GetUseLegacyWebSocketModule(ReactPropertyBag(context->Properties()))) {
|
||||
return std::make_unique<react::uwp::LegacyWebSocketModule>();
|
||||
return std::make_unique<Microsoft::ReactNative::LegacyWebSocketModule>();
|
||||
}
|
||||
return std::make_unique<WebSocketModule>();
|
||||
}
|
||||
|
|
|
@ -47,13 +47,13 @@ void DeviceInfoHolder::InitDeviceInfoHolder(const Mso::React::IReactContext &con
|
|||
}
|
||||
});
|
||||
} else {
|
||||
assert(react::uwp::IsXamlIsland());
|
||||
assert(IsXamlIsland());
|
||||
// This is either a WinUI 3 island or a system XAML island
|
||||
// system XAML islands have a CoreWindow so we want to use the GetForCurrentView APIs
|
||||
// For WinUI 3 islands we require the app to forward window messages as ReactNotifications
|
||||
}
|
||||
|
||||
if (!react::uwp::IsWinUI3Island()) {
|
||||
if (!IsWinUI3Island()) {
|
||||
// UWP or system XAML island
|
||||
auto const &displayInfo = winrt::Windows::Graphics::Display::DisplayInformation::GetForCurrentView();
|
||||
|
||||
|
@ -142,7 +142,7 @@ void DeviceInfoHolder::updateDeviceInfo() noexcept {
|
|||
|
||||
winrt::Windows::UI::ViewManagement::UISettings uiSettings;
|
||||
m_textScaleFactor = uiSettings.TextScaleFactor();
|
||||
if (!react::uwp::IsWinUI3Island()) {
|
||||
if (!IsWinUI3Island()) {
|
||||
auto const displayInfo = winrt::Windows::Graphics::Display::DisplayInformation::GetForCurrentView();
|
||||
m_scale = static_cast<float>(displayInfo.ResolutionScale()) / 100;
|
||||
m_dpi = displayInfo.LogicalDpi();
|
||||
|
|
|
@ -28,7 +28,7 @@ static const React::ReactPropertyId<bool> &ForceRTLPropertyId() noexcept {
|
|||
}
|
||||
|
||||
void I18nManager::InitI18nInfo(const winrt::Microsoft::ReactNative::ReactPropertyBag &propertyBag) noexcept {
|
||||
if (xaml::TryGetCurrentApplication() && !react::uwp::IsXamlIsland()) {
|
||||
if (xaml::TryGetCurrentApplication() && !IsXamlIsland()) {
|
||||
// TODO: Figure out packaged win32 app story for WinUI 3
|
||||
auto layoutDirection = winrt::Windows::ApplicationModel::Resources::Core::ResourceContext()
|
||||
.GetForCurrentView()
|
||||
|
|
|
@ -21,7 +21,7 @@ using namespace Windows::Storage::Streams;
|
|||
using namespace xaml::Media::Imaging;
|
||||
} // namespace winrt
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
//
|
||||
// ImageViewManagerModule::ImageViewManagerModuleImpl
|
||||
//
|
||||
|
@ -168,4 +168,4 @@ auto ImageViewManagerModule::getMethods() -> std::vector<Method> {
|
|||
};
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -10,7 +10,7 @@ class MessageQueueThread;
|
|||
}
|
||||
} // namespace facebook
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
class ImageViewManagerModule : public facebook::xplat::module::CxxModule {
|
||||
public:
|
||||
|
@ -29,4 +29,4 @@ class ImageViewManagerModule : public facebook::xplat::module::CxxModule {
|
|||
std::shared_ptr<ImageViewManagerModuleImpl> m_imageViewManagerModule;
|
||||
};
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -23,7 +23,7 @@ using namespace Windows::Foundation;
|
|||
using namespace Windows::System;
|
||||
using namespace ::Microsoft::Common::Unicode;
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
//
|
||||
// LinkingManagerModule helpers
|
||||
|
@ -124,4 +124,4 @@ auto LinkingManagerModule::getMethods() -> std::vector<Method> {
|
|||
};
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <cxxreact/CxxModule.h>
|
||||
#include <folly/dynamic.h>
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
struct LinkingManagerModule final : facebook::xplat::module::CxxModule {
|
||||
LinkingManagerModule() noexcept;
|
||||
|
@ -28,4 +28,4 @@ struct LinkingManagerModule final : facebook::xplat::module::CxxModule {
|
|||
static std::vector<LinkingManagerModule *> s_linkingModules;
|
||||
};
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -45,7 +45,7 @@ void LogBox::ShowOnUIThread() noexcept {
|
|||
m_popup = xaml::Controls::Primitives::Popup{};
|
||||
xaml::FrameworkElement root{nullptr};
|
||||
|
||||
if (react::uwp::Is19H1OrHigher()) {
|
||||
if (Is19H1OrHigher()) {
|
||||
// XamlRoot added in 19H1 - is required to be set for XamlIsland scenarios
|
||||
if (auto xamlRoot = React::XamlUIService::GetXamlRoot(m_context.Properties().Handle())) {
|
||||
m_popup.XamlRoot(xamlRoot);
|
||||
|
|
|
@ -152,7 +152,7 @@ struct RootShadowNode final : public ShadowNodeBase {
|
|||
RootShadowNode() = delete;
|
||||
|
||||
RootShadowNode(facebook::react::IReactRootView *rootView, INativeUIManagerHost *host) {
|
||||
auto reactRootView = static_cast<react::uwp::IXamlRootView *>(rootView);
|
||||
auto reactRootView = static_cast<IXamlRootView *>(rootView);
|
||||
m_view = reactRootView->GetXamlView();
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ int64_t NativeUIManager::AddMeasuredRootView(facebook::react::IReactRootView *ro
|
|||
}
|
||||
|
||||
void NativeUIManager::AddRootView(ShadowNode &shadowNode, facebook::react::IReactRootView *pReactRootView) {
|
||||
auto xamlRootView = static_cast<react::uwp::IXamlRootView *>(pReactRootView);
|
||||
auto xamlRootView = static_cast<IXamlRootView *>(pReactRootView);
|
||||
XamlView view = xamlRootView->GetXamlView();
|
||||
m_tagsToXamlReactControl.emplace(shadowNode.m_tag, xamlRootView->GetXamlReactControl());
|
||||
|
||||
|
@ -1124,7 +1124,7 @@ void NativeUIManager::blur(int64_t reactTag) {
|
|||
// ReactControl is used here. To get the IXamlReactControl for any node, we
|
||||
// first iterate its parent until reaching the root node. Then look up
|
||||
// m_tagsToXamlReactControl to get the IXamlReactControl
|
||||
std::weak_ptr<react::uwp::IXamlReactControl> NativeUIManager::GetParentXamlReactControl(int64_t tag) const {
|
||||
std::weak_ptr<IXamlReactControl> NativeUIManager::GetParentXamlReactControl(int64_t tag) const {
|
||||
if (auto shadowNode = static_cast<ShadowNodeBase *>(m_host->FindParentRootShadowNode(tag))) {
|
||||
auto it = m_tagsToXamlReactControl.find(shadowNode->m_tag);
|
||||
if (it != m_tagsToXamlReactControl.end()) {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
struct IXamlReactControl;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ class NativeUIManager final : public INativeUIManager {
|
|||
void UpdateExtraLayout(int64_t tag);
|
||||
YGNodeRef GetYogaNode(int64_t tag) const;
|
||||
|
||||
std::weak_ptr<::react::uwp::IXamlReactControl> GetParentXamlReactControl(int64_t tag) const;
|
||||
std::weak_ptr<IXamlReactControl> GetParentXamlReactControl(int64_t tag) const;
|
||||
|
||||
private:
|
||||
INativeUIManagerHost *m_host = nullptr;
|
||||
|
@ -112,7 +112,7 @@ class NativeUIManager final : public INativeUIManager {
|
|||
std::vector<std::function<void()>> m_batchCompletedCallbacks;
|
||||
std::vector<int64_t> m_extraLayoutNodes;
|
||||
|
||||
std::map<int64_t, std::weak_ptr<::react::uwp::IXamlReactControl>> m_tagsToXamlReactControl;
|
||||
std::map<int64_t, std::weak_ptr<IXamlReactControl>> m_tagsToXamlReactControl;
|
||||
};
|
||||
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -25,7 +25,7 @@ using namespace xaml::Media;
|
|||
} // namespace winrt
|
||||
using namespace std;
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
//
|
||||
// TimerQueue
|
||||
|
@ -198,14 +198,14 @@ auto TimingModule::getMethods() -> std::vector<Method> {
|
|||
};
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
std::unique_ptr<facebook::xplat::module::CxxModule> CreateTimingModule(
|
||||
const std::shared_ptr<facebook::react::MessageQueueThread> &) noexcept {
|
||||
return std::make_unique<::react::uwp::TimingModule>();
|
||||
return std::make_unique<Microsoft::ReactNative::TimingModule>();
|
||||
}
|
||||
|
||||
} // namespace react
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include <winrt/Windows.Foundation.h>
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
typedef winrt::Windows::Foundation::DateTime TDateTime;
|
||||
typedef winrt::Windows::Foundation::TimeSpan TTimeSpan;
|
||||
|
@ -88,4 +88,4 @@ class TimingModule : public facebook::xplat::module::CxxModule {
|
|||
std::shared_ptr<Timing> m_timing;
|
||||
};
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace winrt {
|
|||
using namespace Windows::Networking::Sockets;
|
||||
}
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
void OutputDebugString(const char *format, winrt::hresult_error const &e) {
|
||||
char buffer[1024];
|
||||
|
@ -315,4 +315,4 @@ auto LegacyWebSocketModule::getMethods() -> std::vector<Method> {
|
|||
};
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <cxxreact/CxxModule.h>
|
||||
#include <folly/dynamic.h>
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
class LegacyWebSocketModule : public facebook::xplat::module::CxxModule {
|
||||
public:
|
||||
|
@ -25,4 +25,4 @@ class LegacyWebSocketModule : public facebook::xplat::module::CxxModule {
|
|||
std::shared_ptr<WebSocket> m_webSocket;
|
||||
};
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -104,7 +104,7 @@ void ReactApplication::JavaScriptBundleFile(hstring const &value) noexcept {
|
|||
void ReactApplication::OnActivated(Windows::ApplicationModel::Activation::IActivatedEventArgs const &e) {
|
||||
if (e.Kind() == Windows::ApplicationModel::Activation::ActivationKind::Protocol) {
|
||||
auto protocolActivatedEventArgs{e.as<Windows::ApplicationModel::Activation::ProtocolActivatedEventArgs>()};
|
||||
react::uwp::LinkingManagerModule::OpenUri(protocolActivatedEventArgs.Uri());
|
||||
::Microsoft::ReactNative::LinkingManagerModule::OpenUri(protocolActivatedEventArgs.Uri());
|
||||
}
|
||||
this->OnCreate(e);
|
||||
}
|
||||
|
|
|
@ -12,16 +12,13 @@
|
|||
#include <string>
|
||||
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
struct INativeUIManager;
|
||||
class ExpressionAnimationStore;
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
||||
namespace react::uwp {
|
||||
|
||||
struct IXamlRootView;
|
||||
|
||||
typedef unsigned int LiveReloadCallbackCookie;
|
||||
typedef unsigned int ErrorCallbackCookie;
|
||||
typedef unsigned int DebuggerAttachCallbackCookie;
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -325,12 +325,12 @@ void ReactInstanceWin::Initialize() noexcept {
|
|||
Mso::PostFuture(m_uiQueue, [weakThis = Mso::WeakPtr{this}]() noexcept {
|
||||
// Objects that must be created on the UI thread
|
||||
if (auto strongThis = weakThis.GetStrongPtr()) {
|
||||
strongThis->m_appTheme = std::make_shared<::react::uwp::AppTheme>(
|
||||
strongThis->m_appTheme = std::make_shared<Microsoft::ReactNative::AppTheme>(
|
||||
strongThis->GetReactContext(), strongThis->m_uiMessageThread.LoadWithLock());
|
||||
Microsoft::ReactNative::I18nManager::InitI18nInfo(
|
||||
winrt::Microsoft::ReactNative::ReactPropertyBag(strongThis->Options().Properties));
|
||||
strongThis->m_appearanceListener =
|
||||
Mso::Make<::react::uwp::AppearanceChangeListener>(strongThis->GetReactContext(), strongThis->m_uiQueue);
|
||||
strongThis->m_appearanceListener = Mso::Make<Microsoft::ReactNative::AppearanceChangeListener>(
|
||||
strongThis->GetReactContext(), strongThis->m_uiQueue);
|
||||
|
||||
Microsoft::ReactNative::DeviceInfoHolder::InitDeviceInfoHolder(strongThis->GetReactContext());
|
||||
}
|
||||
|
@ -374,7 +374,7 @@ void ReactInstanceWin::Initialize() noexcept {
|
|||
|
||||
// Acquire default modules and then populate with custom modules.
|
||||
// Note that some of these have custom thread affinity.
|
||||
std::vector<facebook::react::NativeModuleDescription> cxxModules = ::react::uwp::GetCoreModules(
|
||||
std::vector<facebook::react::NativeModuleDescription> cxxModules = Microsoft::ReactNative::GetCoreModules(
|
||||
m_batchingUIThread,
|
||||
m_jsMessageThread.Load(),
|
||||
std::move(m_appTheme),
|
||||
|
@ -416,9 +416,9 @@ void ReactInstanceWin::Initialize() noexcept {
|
|||
#endif
|
||||
case JSIEngine::Chakra:
|
||||
if (m_options.EnableByteCodeCaching || !m_options.ByteCodeFileUri.empty()) {
|
||||
scriptStore = std::make_unique<::react::uwp::UwpScriptStore>();
|
||||
preparedScriptStore =
|
||||
std::make_unique<::react::uwp::UwpPreparedScriptStore>(winrt::to_hstring(m_options.ByteCodeFileUri));
|
||||
scriptStore = std::make_unique<Microsoft::ReactNative::UwpScriptStore>();
|
||||
preparedScriptStore = std::make_unique<Microsoft::ReactNative::UwpPreparedScriptStore>(
|
||||
winrt::to_hstring(m_options.ByteCodeFileUri));
|
||||
}
|
||||
devSettings->jsiRuntimeHolder = std::make_shared<Microsoft::JSI::ChakraRuntimeHolder>(
|
||||
devSettings, m_jsMessageThread.Load(), std::move(scriptStore), std::move(preparedScriptStore));
|
||||
|
@ -620,7 +620,7 @@ void ReactInstanceWin::InitUIMessageThread() noexcept {
|
|||
m_uiMessageThread.Exchange(
|
||||
std::make_shared<MessageDispatchQueue>(m_uiQueue, Mso::MakeWeakMemberFunctor(this, &ReactInstanceWin::OnError)));
|
||||
|
||||
auto batchingUIThread = ::react::uwp::MakeBatchingQueueThread(m_uiMessageThread.Load());
|
||||
auto batchingUIThread = Microsoft::ReactNative::MakeBatchingQueueThread(m_uiMessageThread.Load());
|
||||
m_batchingUIThread = batchingUIThread;
|
||||
|
||||
m_jsDispatchQueue.Load().Post(
|
||||
|
|
|
@ -174,8 +174,8 @@ class ReactInstanceWin final : public Mso::ActiveObject<IReactInstanceInternal>
|
|||
|
||||
std::shared_ptr<IRedBoxHandler> m_redboxHandler;
|
||||
#ifndef CORE_ABI
|
||||
std::shared_ptr<react::uwp::AppTheme> m_appTheme;
|
||||
Mso::CntPtr<react::uwp::AppearanceChangeListener> m_appearanceListener;
|
||||
std::shared_ptr<Microsoft::ReactNative::AppTheme> m_appTheme;
|
||||
Mso::CntPtr<Microsoft::ReactNative::AppearanceChangeListener> m_appearanceListener;
|
||||
#endif
|
||||
Mso::DispatchQueue m_uiQueue;
|
||||
std::deque<JSCallEntry> m_jsCallQueue;
|
||||
|
|
|
@ -6,18 +6,14 @@
|
|||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace react::uwp {
|
||||
struct IReactInstance;
|
||||
} // namespace react::uwp
|
||||
|
||||
namespace Microsoft::ReactNative {
|
||||
class IViewManager;
|
||||
struct IReactInstance;
|
||||
|
||||
using NativeViewManager = std::unique_ptr<Microsoft::ReactNative::IViewManager>;
|
||||
|
||||
struct ViewManagerProvider {
|
||||
virtual std::vector<NativeViewManager> GetViewManagers(
|
||||
const std::shared_ptr<::react::uwp::IReactInstance> &instance) = 0;
|
||||
virtual std::vector<NativeViewManager> GetViewManagers(const std::shared_ptr<IReactInstance> &instance) = 0;
|
||||
};
|
||||
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
namespace winrt::Microsoft::ReactNative::implementation {
|
||||
|
||||
ReactRootView::ReactRootView() noexcept {
|
||||
m_rootControl = std::make_shared<react::uwp::ReactRootControl>(*this);
|
||||
m_rootControl = std::make_shared<::Microsoft::ReactNative::ReactRootControl>(*this);
|
||||
UpdatePerspective();
|
||||
Loaded([this](auto &&, auto &&) {
|
||||
::Microsoft::ReactNative::SetCompositor(::Microsoft::ReactNative::GetCompositor(*this));
|
||||
|
|
|
@ -45,7 +45,7 @@ struct ReactRootView : ReactRootViewT<ReactRootView> {
|
|||
ReactNative::JSValueArgWriter m_initialPropsWriter;
|
||||
folly::dynamic m_initialProps;
|
||||
bool m_isPerspectiveEnabled{true};
|
||||
std::shared_ptr<react::uwp::ReactRootControl> m_rootControl;
|
||||
std::shared_ptr<::Microsoft::ReactNative::ReactRootControl> m_rootControl;
|
||||
|
||||
void UpdatePerspective();
|
||||
};
|
||||
|
|
|
@ -118,7 +118,7 @@ struct RedBox : public std::enable_shared_from_this<RedBox> {
|
|||
|
||||
xaml::FrameworkElement root{nullptr};
|
||||
|
||||
if (react::uwp::Is19H1OrHigher()) {
|
||||
if (Microsoft::ReactNative::Is19H1OrHigher()) {
|
||||
// XamlRoot added in 19H1
|
||||
if (auto reactHost = m_weakReactHost.GetStrongPtr()) {
|
||||
if (auto xamlRoot =
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <UI.Xaml.Automation.h>
|
||||
#include <Views/DynamicAutomationProperties.h>
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
REACTWINDOWS_API_(void)
|
||||
AnnounceLiveRegionChangedIfNeeded(const xaml::FrameworkElement &element) {
|
||||
|
@ -33,4 +33,4 @@ HasDynamicAutomationProperties(const xaml::UIElement &element) {
|
|||
|
||||
return false;
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
#include <Shared/ReactWindowsAPI.h>
|
||||
#include "CppWinRTIncludes.h"
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
REACTWINDOWS_API_(void)
|
||||
AnnounceLiveRegionChangedIfNeeded(const xaml::FrameworkElement &element);
|
||||
|
||||
REACTWINDOWS_API_(bool)
|
||||
HasDynamicAutomationProperties(const xaml::UIElement &element);
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -18,7 +18,7 @@ using namespace xaml::Media;
|
|||
using namespace Windows::Foundation::Metadata;
|
||||
} // namespace winrt
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
// Not only react-native, native modules could set tag too for controls.
|
||||
// For example, to identify an clicked item, customer may add tag in
|
||||
|
@ -107,8 +107,8 @@ bool IsWinUI3Island() {
|
|||
#ifndef USE_WINUI3
|
||||
return false;
|
||||
#else
|
||||
return react::uwp::IsXamlIsland();
|
||||
return IsXamlIsland();
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <React.h>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -33,4 +33,4 @@ bool Is19H1OrHigher();
|
|||
bool IsXamlIsland();
|
||||
bool IsWinUI3Island();
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#pragma optimize("", off)
|
||||
#endif
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
std::future<std::string> LocalBundleReader::LoadBundleAsync(const std::string &bundleUri) {
|
||||
winrt::hstring str(Microsoft::Common::Unicode::Utf8ToUtf16(bundleUri));
|
||||
|
@ -76,4 +76,4 @@ void StorageFileBigString::ensure() const {
|
|||
}
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <future>
|
||||
#include <string>
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
class LocalBundleReader {
|
||||
public:
|
||||
|
@ -28,4 +28,4 @@ class StorageFileBigString : public facebook::react::JSBigString {
|
|||
mutable std::string m_string;
|
||||
};
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -101,13 +101,13 @@ bool TryUpdateBackgroundBrush(
|
|||
const std::string &propertyName,
|
||||
const winrt::Microsoft::ReactNative::JSValue &propertyValue) {
|
||||
if (propertyName == "backgroundColor") {
|
||||
if (react::uwp::IsValidColorValue(propertyValue)) {
|
||||
const auto brush = react::uwp::BrushFrom(propertyValue);
|
||||
if (IsValidColorValue(propertyValue)) {
|
||||
const auto brush = BrushFrom(propertyValue);
|
||||
element.Background(brush);
|
||||
react::uwp::UpdateControlBackgroundResourceBrushes(element, brush);
|
||||
UpdateControlBackgroundResourceBrushes(element, brush);
|
||||
} else if (propertyValue.IsNull()) {
|
||||
element.ClearValue(T::BackgroundProperty());
|
||||
react::uwp::UpdateControlBackgroundResourceBrushes(element, nullptr);
|
||||
UpdateControlBackgroundResourceBrushes(element, nullptr);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -139,13 +139,13 @@ bool TryUpdateForeground(
|
|||
const std::string &propertyName,
|
||||
const winrt::Microsoft::ReactNative::JSValue &propertyValue) {
|
||||
if (propertyName == "color") {
|
||||
if (react::uwp::IsValidColorValue(propertyValue)) {
|
||||
const auto brush = react::uwp::BrushFrom(propertyValue);
|
||||
if (IsValidColorValue(propertyValue)) {
|
||||
const auto brush = BrushFrom(propertyValue);
|
||||
element.Foreground(brush);
|
||||
react::uwp::UpdateControlForegroundResourceBrushes(element, brush);
|
||||
UpdateControlForegroundResourceBrushes(element, brush);
|
||||
} else if (propertyValue.IsNull()) {
|
||||
element.ClearValue(T::ForegroundProperty());
|
||||
react::uwp::UpdateControlForegroundResourceBrushes(element, nullptr);
|
||||
UpdateControlForegroundResourceBrushes(element, nullptr);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -163,18 +163,18 @@ bool TryUpdateBorderProperties(
|
|||
bool isBorderProperty = true;
|
||||
|
||||
if (propertyName == "borderColor") {
|
||||
if (react::uwp::IsValidColorValue(propertyValue)) {
|
||||
const auto brush = react::uwp::BrushFrom(propertyValue);
|
||||
if (IsValidColorValue(propertyValue)) {
|
||||
const auto brush = BrushFrom(propertyValue);
|
||||
element.BorderBrush(brush);
|
||||
react::uwp::UpdateControlBorderResourceBrushes(element, brush);
|
||||
UpdateControlBorderResourceBrushes(element, brush);
|
||||
} else if (propertyValue.IsNull()) {
|
||||
// If there's still a border thickness, use the default border brush.
|
||||
if (element.BorderThickness() != xaml::ThicknessHelper::FromUniformLength(0.0)) {
|
||||
element.BorderBrush(react::uwp::DefaultBrushStore::Instance().GetDefaultBorderBrush());
|
||||
element.BorderBrush(DefaultBrushStore::Instance().GetDefaultBorderBrush());
|
||||
} else {
|
||||
element.ClearValue(T::BorderBrushProperty());
|
||||
}
|
||||
react::uwp::UpdateControlBorderResourceBrushes(element, nullptr);
|
||||
UpdateControlBorderResourceBrushes(element, nullptr);
|
||||
}
|
||||
} else {
|
||||
auto iter = edgeTypeMap.find(propertyName);
|
||||
|
@ -186,7 +186,7 @@ bool TryUpdateBorderProperties(
|
|||
// Borders with no brush draw something other than transparent on other platforms.
|
||||
// To match, we'll use a default border brush if one isn't already set.
|
||||
// Note: Keep this in sync with code in ViewPanel::FinalizeProperties().
|
||||
element.BorderBrush(react::uwp::DefaultBrushStore::Instance().GetDefaultBorderBrush());
|
||||
element.BorderBrush(DefaultBrushStore::Instance().GetDefaultBorderBrush());
|
||||
}
|
||||
} else if (propertyValue.IsNull()) {
|
||||
SetBorderThickness(node, element, iter->second, 0);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <Utils/ResourceBrushUtils.h>
|
||||
#include <Utils/StandardControlResourceKeyNames.h>
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
DefaultBrushStore::DefaultBrushStore() {}
|
||||
|
||||
|
@ -147,4 +147,4 @@ void UpdateControlBorderResourceBrushes(const xaml::FrameworkElement &element, c
|
|||
}
|
||||
}
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <UI.Xaml.Media.h>
|
||||
#include "CppWinRTIncludes.h"
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
|
||||
// Helper per-UI-thread singleton class to cache brushes used as defaults.
|
||||
class DefaultBrushStore {
|
||||
|
@ -47,4 +47,4 @@ void UpdateToggleSwitchTrackResourceBrushes(
|
|||
const xaml::Media::Brush onTrackBrush,
|
||||
const xaml::Media::Brush offTrackBrush);
|
||||
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -17,7 +17,7 @@ using namespace winrt::Windows::Foundation;
|
|||
using namespace winrt::Windows::Storage;
|
||||
}; // namespace winrt
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
UwpPreparedScriptStore::UwpPreparedScriptStore(winrt::hstring uri) {
|
||||
if (!uri.empty()) {
|
||||
m_byteCodeFileAsync = winrt::StorageFile::GetFileFromApplicationUriAsync(winrt::Uri(uri));
|
||||
|
@ -104,4 +104,4 @@ winrt::StorageFile UwpPreparedScriptStore::TryGetByteCodeFileSync(
|
|||
|
||||
return byteCodeVersion > scriptSignature.version ? file : nullptr;
|
||||
}
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <future>
|
||||
#include <string>
|
||||
|
||||
namespace react::uwp {
|
||||
namespace Microsoft::ReactNative {
|
||||
class UwpPreparedScriptStore : public facebook::jsi::PreparedScriptStore {
|
||||
public:
|
||||
UwpPreparedScriptStore(winrt::hstring uri);
|
||||
|
@ -61,4 +61,4 @@ class ByteCodeBuffer final : public facebook::jsi::Buffer {
|
|||
int size_;
|
||||
std::unique_ptr<uint8_t[]> byteArray_;
|
||||
};
|
||||
} // namespace react::uwp
|
||||
} // namespace Microsoft::ReactNative
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче