BLUE
PHP 7.4.33
Path:
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/react-native/Libraries/Wrapper
Run
Logout
Edit File
Size: 3.30 KB
Close
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/react-native/Libraries/Wrapper/RCTWrapperShadowView.m
Text
Base64
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #import "RCTWrapperShadowView.h" #import <React/RCTBridge.h> #import <React/RCTShadowView+Layout.h> #import <React/RCTUIManager.h> #import "RCTWrapperView.h" @implementation RCTWrapperShadowView { __weak RCTBridge *_bridge; RCTWrapperMeasureBlock _measureBlock; CGSize _intrinsicContentSize; } - (instancetype)initWithBridge:(RCTBridge *)bridge { if (self = [super init]) { _bridge = bridge; YGNodeSetMeasureFunc(self.yogaNode, RCTWrapperShadowViewMeasure); } return self; } static YGSize RCTWrapperShadowViewMeasure( YGNodeConstRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode) { CGSize minimumSize = CGSizeMake(0, 0); CGSize maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX); switch (widthMode) { case YGMeasureModeUndefined: break; case YGMeasureModeExactly: minimumSize.width = width; maximumSize.width = width; break; case YGMeasureModeAtMost: maximumSize.width = width; break; } switch (heightMode) { case YGMeasureModeUndefined: break; case YGMeasureModeExactly: minimumSize.height = height; maximumSize.height = height; break; case YGMeasureModeAtMost: maximumSize.height = height; break; } RCTWrapperShadowView *shadowView = (__bridge RCTWrapperShadowView *)YGNodeGetContext(node); CGSize size = [shadowView measureWithMinimumSize:minimumSize maximumSize:maximumSize]; return (YGSize){RCTYogaFloatFromCoreGraphicsFloat(size.width), RCTYogaFloatFromCoreGraphicsFloat(size.height)}; } - (CGSize)measureWithMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize { dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC); if (!_measureBlock) { RCTBridge *bridge = _bridge; __block RCTWrapperMeasureBlock measureBlock; NSNumber *reactTag = self.reactTag; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); dispatch_async(dispatch_get_main_queue(), ^{ RCTUIManager *uiManager = bridge.uiManager; RCTWrapperView *view = (RCTWrapperView *)[uiManager viewForReactTag:reactTag]; measureBlock = view.measureBlock; dispatch_semaphore_signal(semaphore); }); if (dispatch_semaphore_wait(semaphore, timeout)) { RCTLogError(@"Unable to retrieve `measureBlock` for view (%@) because the main thread is busy.", self); } _measureBlock = measureBlock; } if (!_measureBlock) { return maximumSize; } __block CGSize size = maximumSize; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); dispatch_async(dispatch_get_main_queue(), ^{ size = self->_measureBlock(minimumSize, maximumSize); dispatch_semaphore_signal(semaphore); }); if (dispatch_semaphore_wait(semaphore, timeout)) { RCTLogError(@"Unable to compute layout for view (%@) because the main thread is busy.", self); } return size; } - (BOOL)isYogaLeafNode { return YES; } - (CGSize)intrinsicContentSize { return _intrinsicContentSize; } - (void)setIntrinsicContentSize:(CGSize)size { _intrinsicContentSize = size; YGNodeMarkDirty(self.yogaNode); } @end
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 9
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Example
DIR
-
drwxr-xr-x
2025-03-28 11:04:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTWrapper.h
4.53 KB
lrw-r--r--
2025-03-28 11:04:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTWrapperShadowView.h
449 B
lrw-r--r--
2025-03-28 11:04:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTWrapperShadowView.m
3.30 KB
lrw-r--r--
2025-03-28 11:04:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTWrapperView.h
1.09 KB
lrw-r--r--
2025-03-28 11:04:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTWrapperView.m
2.07 KB
lrw-r--r--
2025-03-28 11:04:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTWrapperViewControllerHostingView.h
748 B
lrw-r--r--
2025-03-28 11:04:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTWrapperViewControllerHostingView.m
3.41 KB
lrw-r--r--
2025-03-28 11:04:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTWrapperViewManager.h
398 B
lrw-r--r--
2025-03-28 11:04:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTWrapperViewManager.m
539 B
lrw-r--r--
2025-03-28 11:04:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).