├── .bazelrc ├── .github └── ISSUE_TEMPLATE │ └── bug_report.yaml ├── .gitignore ├── .gitmodules ├── LICENSE ├── Makefile ├── README.md ├── WORKSPACE ├── Wallet ├── BUILD ├── Icons.xcassets │ ├── AppIconWallet.appiconset │ │ ├── Contents.json │ │ ├── GramIcon-iTunesArtwork.png │ │ ├── GramIcon@120x120-1.png │ │ ├── GramIcon@120x120.png │ │ ├── GramIcon@152x152.png │ │ ├── GramIcon@167x167.png │ │ ├── GramIcon@180x180.png │ │ ├── GramIcon@20x20.png │ │ ├── GramIcon@29x29.png │ │ ├── GramIcon@40x40-1.png │ │ ├── GramIcon@40x40-2.png │ │ ├── GramIcon@40x40.png │ │ ├── GramIcon@58x58-1.png │ │ ├── GramIcon@58x58.png │ │ ├── GramIcon@60x60.png │ │ ├── GramIcon@76x76.png │ │ ├── GramIcon@80x80-1.png │ │ ├── GramIcon@80x80.png │ │ └── GramIcon@87x87.png │ └── Contents.json ├── LaunchScreen.xib ├── Sources │ ├── AppDelegate.swift │ ├── Application.swift │ └── main.m └── Strings │ └── en.lproj │ └── Localizable.strings ├── build-system ├── bazel-utils │ ├── BUILD │ └── plist_fragment.bzl ├── bazel.rb ├── bazel_version ├── copy-provisioning-profiles-Wallet.sh ├── generate-xcode-project.sh ├── prepare-build-variables-Wallet.sh ├── prepare-build.sh └── xcode_version ├── submodules ├── ActivityIndicator │ ├── BUILD │ └── Sources │ │ └── ActivityIndicator.swift ├── AlertUI │ ├── BUILD │ └── Sources │ │ └── ThemedTextAlertController.swift ├── AnimatedStickerNode │ ├── BUILD │ └── Sources │ │ ├── AnimatedStickerNode.swift │ │ ├── AnimationRenderer.swift │ │ └── SoftwareAnimationRenderer.swift ├── AppBundle │ ├── BUILD │ ├── PublicHeaders │ │ └── AppBundle │ │ │ └── AppBundle.h │ └── Sources │ │ └── AppBundle │ │ └── AppBundle.m ├── AsyncDisplayKit │ ├── BUILD │ └── Source │ │ ├── ASAbstractLayoutController+FrameworkPrivate.h │ │ ├── ASAsciiArtBoxCreator.mm │ │ ├── ASAssert.mm │ │ ├── ASCGImageBuffer.h │ │ ├── ASCGImageBuffer.mm │ │ ├── ASCollections.mm │ │ ├── ASConfiguration.mm │ │ ├── ASConfigurationInternal.mm │ │ ├── ASControlNode+Private.h │ │ ├── ASControlNode.mm │ │ ├── ASControlTargetAction.mm │ │ ├── ASDimension.mm │ │ ├── ASDimensionInternal.mm │ │ ├── ASDispatch.h │ │ ├── ASDispatch.mm │ │ ├── ASDisplayNode+Ancestry.mm │ │ ├── ASDisplayNode+AsyncDisplay.mm │ │ ├── ASDisplayNode+Convenience.mm │ │ ├── ASDisplayNode+Deprecated.h │ │ ├── ASDisplayNode+Layout.mm │ │ ├── ASDisplayNode+LayoutSpec.mm │ │ ├── ASDisplayNode+UIViewBridge.mm │ │ ├── ASDisplayNode.mm │ │ ├── ASDisplayNodeExtras.mm │ │ ├── ASDisplayNodeInternal.h │ │ ├── ASDisplayNodeLayout.h │ │ ├── ASEditableTextNode.mm │ │ ├── ASExperimentalFeatures.mm │ │ ├── ASGraphicsContext.mm │ │ ├── ASHashing.mm │ │ ├── ASInternalHelpers.mm │ │ ├── ASLayout.mm │ │ ├── ASLayoutElement.mm │ │ ├── ASLayoutElementStylePrivate.h │ │ ├── ASLayoutManager.h │ │ ├── ASLayoutManager.mm │ │ ├── ASLayoutSpec+Subclasses.h │ │ ├── ASLayoutSpec+Subclasses.mm │ │ ├── ASLayoutSpec.mm │ │ ├── ASLayoutSpecPrivate.h │ │ ├── ASLayoutSpecUtilities.h │ │ ├── ASLayoutTransition.h │ │ ├── ASLayoutTransition.mm │ │ ├── ASMainSerialQueue.h │ │ ├── ASMainSerialQueue.mm │ │ ├── ASMainThreadDeallocation.mm │ │ ├── ASObjectDescriptionHelpers.mm │ │ ├── ASPendingStateController.h │ │ ├── ASPendingStateController.mm │ │ ├── ASRecursiveUnfairLock.mm │ │ ├── ASResponderChainEnumerator.h │ │ ├── ASResponderChainEnumerator.mm │ │ ├── ASRunLoopQueue.mm │ │ ├── ASScrollDirection.mm │ │ ├── ASScrollNode.mm │ │ ├── ASSignpost.h │ │ ├── ASTextKitComponents.mm │ │ ├── ASTextKitContext.h │ │ ├── ASTextKitContext.mm │ │ ├── ASTextNodeCommon.h │ │ ├── ASTextNodeWordKerner.h │ │ ├── ASTextNodeWordKerner.mm │ │ ├── ASTraitCollection.mm │ │ ├── ASWeakMap.h │ │ ├── ASWeakMap.mm │ │ ├── ASWeakProxy.h │ │ ├── ASWeakProxy.mm │ │ ├── ASWeakSet.mm │ │ ├── NSArray+Diffing.mm │ │ ├── NSIndexSet+ASHelpers.h │ │ ├── NSIndexSet+ASHelpers.mm │ │ ├── PublicHeaders │ │ └── AsyncDisplayKit │ │ │ ├── ASAbsoluteLayoutElement.h │ │ │ ├── ASAsciiArtBoxCreator.h │ │ │ ├── ASAssert.h │ │ │ ├── ASAvailability.h │ │ │ ├── ASBaseDefines.h │ │ │ ├── ASBlockTypes.h │ │ │ ├── ASCollections.h │ │ │ ├── ASConfiguration.h │ │ │ ├── ASConfigurationDelegate.h │ │ │ ├── ASConfigurationInternal.h │ │ │ ├── ASContextTransitioning.h │ │ │ ├── ASControlNode+Subclasses.h │ │ │ ├── ASControlNode.h │ │ │ ├── ASControlTargetAction.h │ │ │ ├── ASDimension.h │ │ │ ├── ASDimensionInternal.h │ │ │ ├── ASDisplayNode+Ancestry.h │ │ │ ├── ASDisplayNode+Beta.h │ │ │ ├── ASDisplayNode+Convenience.h │ │ │ ├── ASDisplayNode+FrameworkPrivate.h │ │ │ ├── ASDisplayNode+InterfaceState.h │ │ │ ├── ASDisplayNode+LayoutSpec.h │ │ │ ├── ASDisplayNode+Subclasses.h │ │ │ ├── ASDisplayNode.h │ │ │ ├── ASDisplayNodeExtras.h │ │ │ ├── ASEditableTextNode.h │ │ │ ├── ASEqualityHelpers.h │ │ │ ├── ASExperimentalFeatures.h │ │ │ ├── ASGraphicsContext.h │ │ │ ├── ASHashing.h │ │ │ ├── ASInternalHelpers.h │ │ │ ├── ASLayout.h │ │ │ ├── ASLayoutElement.h │ │ │ ├── ASLayoutElementExtensibility.h │ │ │ ├── ASLayoutElementPrivate.h │ │ │ ├── ASLayoutSpec.h │ │ │ ├── ASLocking.h │ │ │ ├── ASMainThreadDeallocation.h │ │ │ ├── ASObjectDescriptionHelpers.h │ │ │ ├── ASRecursiveUnfairLock.h │ │ │ ├── ASRunLoopQueue.h │ │ │ ├── ASScrollDirection.h │ │ │ ├── ASScrollNode.h │ │ │ ├── ASStackLayoutDefines.h │ │ │ ├── ASStackLayoutElement.h │ │ │ ├── ASTextKitComponents.h │ │ │ ├── ASTextNodeTypes.h │ │ │ ├── ASThread.h │ │ │ ├── ASTraitCollection.h │ │ │ ├── ASWeakSet.h │ │ │ ├── AsyncDisplayKit.h │ │ │ ├── CoreGraphics+ASConvenience.h │ │ │ ├── NSArray+Diffing.h │ │ │ ├── UIResponder+AsyncDisplayKit.h │ │ │ ├── UIView+ASConvenience.h │ │ │ ├── _ASAsyncTransaction.h │ │ │ ├── _ASAsyncTransactionContainer.h │ │ │ ├── _ASAsyncTransactionGroup.h │ │ │ ├── _ASCoreAnimationExtras.h │ │ │ ├── _ASDisplayLayer.h │ │ │ ├── _ASDisplayView.h │ │ │ └── _ASTransitionContext.h │ │ ├── UIResponder+AsyncDisplayKit.mm │ │ ├── _ASAsyncTransaction.mm │ │ ├── _ASAsyncTransactionContainer+Private.h │ │ ├── _ASAsyncTransactionContainer.mm │ │ ├── _ASAsyncTransactionGroup.mm │ │ ├── _ASCoreAnimationExtras.mm │ │ ├── _ASDisplayLayer.mm │ │ ├── _ASDisplayView.mm │ │ ├── _ASDisplayViewAccessiblity.h │ │ ├── _ASDisplayViewAccessiblity.mm │ │ ├── _ASPendingState.h │ │ ├── _ASPendingState.mm │ │ ├── _ASScopeTimer.h │ │ └── _ASTransitionContext.mm ├── BuildConfig │ ├── BUILD │ └── Sources │ │ ├── BuildConfig.h │ │ └── BuildConfig.m ├── Camera │ ├── BUILD │ └── Sources │ │ ├── Camera.swift │ │ ├── CameraDevice.swift │ │ ├── CameraInput.swift │ │ ├── CameraOutput.swift │ │ ├── CameraPreviewNode.swift │ │ └── CameraUtils.swift ├── Display │ ├── BUILD │ └── Source │ │ ├── ASTransformLayerNode.swift │ │ ├── Accessibility.swift │ │ ├── AccessibilityAreaNode.swift │ │ ├── ActionSheetButtonItem.swift │ │ ├── ActionSheetCheckboxItem.swift │ │ ├── ActionSheetController.swift │ │ ├── ActionSheetControllerNode.swift │ │ ├── ActionSheetItem.swift │ │ ├── ActionSheetItemGroup.swift │ │ ├── ActionSheetItemGroupNode.swift │ │ ├── ActionSheetItemGroupsContainerNode.swift │ │ ├── ActionSheetItemNode.swift │ │ ├── ActionSheetSwitchItem.swift │ │ ├── ActionSheetTextItem.swift │ │ ├── ActionSheetTheme.swift │ │ ├── AlertContentNode.swift │ │ ├── AlertController.swift │ │ ├── AlertControllerNode.swift │ │ ├── CAAnimationUtils.swift │ │ ├── ChildWindowHostView.swift │ │ ├── CollectionIndexNode.swift │ │ ├── ContainableController.swift │ │ ├── ContainedViewLayoutTransition.swift │ │ ├── ContainerViewLayout.swift │ │ ├── ContextContentContainerNode.swift │ │ ├── ContextContentSourceNode.swift │ │ ├── ContextControllerSourceNode.swift │ │ ├── ContextGesture.swift │ │ ├── ContextMenuAction.swift │ │ ├── ContextMenuActionNode.swift │ │ ├── ContextMenuContainerNode.swift │ │ ├── ContextMenuController.swift │ │ ├── ContextMenuNode.swift │ │ ├── DeviceMetrics.swift │ │ ├── DisplayLinkAnimator.swift │ │ ├── DisplayLinkDispatcher.swift │ │ ├── EditableTextNode.swift │ │ ├── Font.swift │ │ ├── GenerateImage.swift │ │ ├── GlobalOverlayPresentationContext.swift │ │ ├── GridItem.swift │ │ ├── GridItemNode.swift │ │ ├── GridNode.swift │ │ ├── GridNodeScroller.swift │ │ ├── HapticFeedback.swift │ │ ├── HighlightTrackingButton.swift │ │ ├── HighlightableButton.swift │ │ ├── ImageCorners.swift │ │ ├── ImageNode.swift │ │ ├── ImmediateTextNode.swift │ │ ├── InteractiveTransitionGestureRecognizer.swift │ │ ├── KeyShortcut.swift │ │ ├── KeyShortcutsController.swift │ │ ├── Keyboard.swift │ │ ├── KeyboardManager.swift │ │ ├── LayoutSizes.swift │ │ ├── LegacyPresentedController.swift │ │ ├── LegacyPresentedControllerNode.swift │ │ ├── LinkHighlightingNode.swift │ │ ├── ListView.swift │ │ ├── ListViewAccessoryItem.swift │ │ ├── ListViewAccessoryItemNode.swift │ │ ├── ListViewAnimation.swift │ │ ├── ListViewFloatingHeaderNode.swift │ │ ├── ListViewIntermediateState.swift │ │ ├── ListViewItem.swift │ │ ├── ListViewItemHeader.swift │ │ ├── ListViewItemNode.swift │ │ ├── ListViewOverscrollBackgroundNode.swift │ │ ├── ListViewReorderingGestureRecognizer.swift │ │ ├── ListViewReorderingItemNode.swift │ │ ├── ListViewScroller.swift │ │ ├── ListViewTapGestureRecognizer.swift │ │ ├── ListViewTempItemNode.swift │ │ ├── ListViewTransactionQueue.swift │ │ ├── MinimizeKeyboardGestureRecognizer.swift │ │ ├── NativeWindowHostView.swift │ │ ├── Navigation │ │ ├── NavigationContainer.swift │ │ ├── NavigationController.swift │ │ ├── NavigationLayout.swift │ │ ├── NavigationModalContainer.swift │ │ ├── NavigationModalFrame.swift │ │ ├── NavigationOverlayContainer.swift │ │ └── NavigationSplitContainer.swift │ │ ├── NavigationBackButtonNode.swift │ │ ├── NavigationBar.swift │ │ ├── NavigationBarBadge.swift │ │ ├── NavigationBarContentNode.swift │ │ ├── NavigationBarTitleTransitionNode.swift │ │ ├── NavigationBarTitleView.swift │ │ ├── NavigationBarTransitionContainer.swift │ │ ├── NavigationBarTransitionState.swift │ │ ├── NavigationButtonNode.swift │ │ ├── NavigationTitleNode.swift │ │ ├── NavigationTransitionCoordinator.swift │ │ ├── Nodes │ │ ├── ASImageNode.swift │ │ └── ButtonNode.swift │ │ ├── PageControlNode.swift │ │ ├── PeekController.swift │ │ ├── PeekControllerContent.swift │ │ ├── PeekControllerGestureRecognizer.swift │ │ ├── PeekControllerMenuItemNode.swift │ │ ├── PeekControllerMenuNode.swift │ │ ├── PeekControllerNode.swift │ │ ├── PointerInteraction.swift │ │ ├── PresentationContext.swift │ │ ├── RuntimeUtils.swift │ │ ├── ScrollToTopProxyView.swift │ │ ├── ShakeAnimation.swift │ │ ├── Spring.swift │ │ ├── StatusBar.swift │ │ ├── StatusBarHost.swift │ │ ├── StatusBarProxyNode.swift │ │ ├── SubstringSearch.swift │ │ ├── SwitchNode.swift │ │ ├── TabBarContollerNode.swift │ │ ├── TabBarController.swift │ │ ├── TabBarNode.swift │ │ ├── TabBarTapRecognizer.swift │ │ ├── TapLongTapOrDoubleTapGestureRecognizer.swift │ │ ├── TextAlertController.swift │ │ ├── TextFieldNode.swift │ │ ├── TextNode.swift │ │ ├── Toolbar.swift │ │ ├── ToolbarNode.swift │ │ ├── TooltipController.swift │ │ ├── TooltipControllerNode.swift │ │ ├── TransformImageArguments.swift │ │ ├── TransformImageNode.swift │ │ ├── UIKitUtils.swift │ │ ├── UITracingLayerView.swift │ │ ├── UniversalMasterController.swift │ │ ├── UniversalTapRecognizer.swift │ │ ├── ViewController.swift │ │ ├── ViewControllerPreviewing.swift │ │ ├── ViewControllerTracingNode.swift │ │ ├── VolumeControlStatusBar.swift │ │ ├── WallpaperBackgroundNode.swift │ │ ├── WindowContent.swift │ │ ├── WindowCoveringView.swift │ │ ├── WindowInputAccessoryHeightProvider.swift │ │ └── WindowPanRecognizer.swift ├── GZip │ ├── BUILD │ └── Sources │ │ ├── GZip.h │ │ └── GZip.m ├── GlassButtonNode │ ├── BUILD │ └── Sources │ │ └── GlassButtonNode.swift ├── LocalAuth │ ├── BUILD │ └── Sources │ │ └── LocalAuth.swift ├── Markdown │ ├── BUILD │ └── Source │ │ └── Markdown.swift ├── MergeLists │ ├── BUILD │ └── Sources │ │ ├── Identifiable.swift │ │ └── MergeLists.swift ├── NumberPluralizationForm │ ├── BUILD │ ├── PublicHeaders │ │ └── NumberPluralizationForm │ │ │ └── NumberPluralizationForm.h │ └── Sources │ │ └── NumberPluralizationForm.m ├── ObjCRuntimeUtils │ ├── BUILD │ └── Source │ │ └── ObjCRuntimeUtils │ │ ├── RuntimeUtils.h │ │ └── RuntimeUtils.m ├── OverlayStatusController │ ├── BUILD │ ├── Impl │ │ ├── BUILD │ │ └── Sources │ │ │ └── OverlayStatusControllerImpl │ │ │ ├── ProgressSpinnerView.h │ │ │ ├── ProgressSpinnerView.m │ │ │ ├── ProgressWindow.h │ │ │ ├── ProgressWindow.m │ │ │ ├── ProxyWindow.h │ │ │ └── ProxyWindow.m │ └── Sources │ │ └── OverlayStatusController.swift ├── ProgressNavigationButtonNode │ ├── BUILD │ └── Sources │ │ └── ProgressNavigationButtonNode.swift ├── QrCode │ ├── BUILD │ └── Sources │ │ └── QrCode.swift ├── SSignalKit │ ├── SSignalKit │ │ ├── BUILD │ │ └── Source │ │ │ └── SSignalKit │ │ │ ├── SAtomic.h │ │ │ ├── SAtomic.m │ │ │ ├── SBag.h │ │ │ ├── SBag.m │ │ │ ├── SBlockDisposable.h │ │ │ ├── SBlockDisposable.m │ │ │ ├── SDisposable.h │ │ │ ├── SDisposableSet.h │ │ │ ├── SDisposableSet.m │ │ │ ├── SMetaDisposable.h │ │ │ ├── SMetaDisposable.m │ │ │ ├── SMulticastSignalManager.h │ │ │ ├── SMulticastSignalManager.m │ │ │ ├── SQueue.h │ │ │ ├── SQueue.m │ │ │ ├── SSignal+Accumulate.h │ │ │ ├── SSignal+Accumulate.m │ │ │ ├── SSignal+Catch.h │ │ │ ├── SSignal+Catch.m │ │ │ ├── SSignal+Combine.h │ │ │ ├── SSignal+Combine.m │ │ │ ├── SSignal+Dispatch.h │ │ │ ├── SSignal+Dispatch.m │ │ │ ├── SSignal+Mapping.h │ │ │ ├── SSignal+Mapping.m │ │ │ ├── SSignal+Meta.h │ │ │ ├── SSignal+Meta.m │ │ │ ├── SSignal+Multicast.h │ │ │ ├── SSignal+Multicast.m │ │ │ ├── SSignal+Pipe.h │ │ │ ├── SSignal+Pipe.m │ │ │ ├── SSignal+SideEffects.h │ │ │ ├── SSignal+SideEffects.m │ │ │ ├── SSignal+Single.h │ │ │ ├── SSignal+Single.m │ │ │ ├── SSignal+Take.h │ │ │ ├── SSignal+Take.m │ │ │ ├── SSignal+Timing.h │ │ │ ├── SSignal+Timing.m │ │ │ ├── SSignal.h │ │ │ ├── SSignal.m │ │ │ ├── SSignalKit.h │ │ │ ├── SSubscriber.h │ │ │ ├── SSubscriber.m │ │ │ ├── SThreadPool.h │ │ │ ├── SThreadPool.m │ │ │ ├── SThreadPoolQueue.h │ │ │ ├── SThreadPoolQueue.m │ │ │ ├── SThreadPoolTask.h │ │ │ ├── SThreadPoolTask.m │ │ │ ├── STimer.h │ │ │ ├── STimer.m │ │ │ ├── SVariable.h │ │ │ └── SVariable.m │ └── SwiftSignalKit │ │ ├── BUILD │ │ └── Source │ │ ├── Atomic.swift │ │ ├── Bag.swift │ │ ├── Disposable.swift │ │ ├── Lock.swift │ │ ├── Multicast.swift │ │ ├── Promise.swift │ │ ├── Queue.swift │ │ ├── QueueLocalObject.swift │ │ ├── Signal.swift │ │ ├── Signal_Catch.swift │ │ ├── Signal_Combine.swift │ │ ├── Signal_Dispatch.swift │ │ ├── Signal_Loop.swift │ │ ├── Signal_Mapping.swift │ │ ├── Signal_Materialize.swift │ │ ├── Signal_Merge.swift │ │ ├── Signal_Meta.swift │ │ ├── Signal_Reduce.swift │ │ ├── Signal_SideEffects.swift │ │ ├── Signal_Single.swift │ │ ├── Signal_Take.swift │ │ ├── Signal_Timing.swift │ │ ├── Subscriber.swift │ │ ├── ThreadPool.swift │ │ ├── Timer.swift │ │ └── ValuePipe.swift ├── ScreenCaptureDetection │ ├── BUILD │ └── Sources │ │ └── ScreenCaptureDetection.swift ├── SolidRoundedButtonNode │ ├── BUILD │ └── Sources │ │ └── SolidRoundedButtonNode.swift ├── StringPluralization │ ├── BUILD │ └── Sources │ │ └── StringPluralization.swift ├── TonBinding │ ├── BUILD │ └── Sources │ │ ├── TON.h │ │ └── TON.mm ├── UIKitRuntimeUtils │ ├── BUILD │ └── Source │ │ └── UIKitRuntimeUtils │ │ ├── NSBag.h │ │ ├── NSBag.m │ │ ├── NSWeakReference.h │ │ ├── NSWeakReference.m │ │ ├── NotificationCenterUtils.h │ │ ├── NotificationCenterUtils.m │ │ ├── UIBarButtonItem+Proxy.h │ │ ├── UIBarButtonItem+Proxy.m │ │ ├── UIKitUtils.h │ │ ├── UIKitUtils.m │ │ ├── UIMenuItem+Icons.h │ │ ├── UIMenuItem+Icons.m │ │ ├── UINavigationItem+Proxy.h │ │ ├── UINavigationItem+Proxy.m │ │ ├── UIViewController+Navigation.h │ │ ├── UIViewController+Navigation.m │ │ ├── UIWindow+OrientationChange.h │ │ └── UIWindow+OrientationChange.m ├── UrlEscaping │ ├── BUILD │ └── Sources │ │ └── UrlEscaping.swift ├── WalletCore │ ├── BUILD │ └── Sources │ │ └── WalletCore.swift ├── WalletUI │ ├── BUILD │ ├── Resources │ │ ├── Animations │ │ │ ├── SendingGrams.tgs │ │ │ ├── WalletApologiesAccepted.tgs │ │ │ ├── WalletCreated.tgs │ │ │ ├── WalletDone.tgs │ │ │ ├── WalletEmpty.tgs │ │ │ ├── WalletInitializing.tgs │ │ │ ├── WalletIntroLoading.tgs │ │ │ ├── WalletIntroStatic.tgs │ │ │ ├── WalletKeyLock.tgs │ │ │ ├── WalletNotAvailable.tgs │ │ │ ├── WalletSynchronization.tgs │ │ │ ├── WalletWordCheck.tgs │ │ │ └── WalletWordList.tgs │ │ └── WalletStrings.mapping │ ├── Sources │ │ ├── ItemList │ │ │ ├── ItemListController.swift │ │ │ ├── ItemListControllerEmptyStateItem.swift │ │ │ ├── ItemListControllerNode.swift │ │ │ ├── ItemListControllerSearch.swift │ │ │ ├── ItemListItem.swift │ │ │ ├── ItemListLoadingIndicatorEmptyStateItem.swift │ │ │ └── Items │ │ │ │ ├── ItemListActionItem.swift │ │ │ │ ├── ItemListCheckboxItem.swift │ │ │ │ ├── ItemListDisclosureItem.swift │ │ │ │ ├── ItemListMultilineInputItem.swift │ │ │ │ ├── ItemListMultilineTextItem.swift │ │ │ │ ├── ItemListSectionHeaderItem.swift │ │ │ │ ├── ItemListSingleLineInputItem.swift │ │ │ │ ├── ItemListSwitchItem.swift │ │ │ │ └── ItemListTextItem.swift │ │ ├── ToastNode.swift │ │ ├── WalletAmountItem.swift │ │ ├── WalletBalanceItem.swift │ │ ├── WalletBuyGramsScreen.swift │ │ ├── WalletConfgurationScreen.swift │ │ ├── WalletConfiguration.swift │ │ ├── WalletContext.swift │ │ ├── WalletCreateInvoiceScreen.swift │ │ ├── WalletInfoEmptyNode.swift │ │ ├── WalletInfoScreen.swift │ │ ├── WalletInfoTransactionItem.swift │ │ ├── WalletPresentationData.swift │ │ ├── WalletQrScanScreen.swift │ │ ├── WalletReceiveScreen.swift │ │ ├── WalletRefreshNode.swift │ │ ├── WalletSendScreen.swift │ │ ├── WalletSettingsScreen.swift │ │ ├── WalletSplashScreen.swift │ │ ├── WalletStrings.swift │ │ ├── WalletTransactionInfoScreen.swift │ │ ├── WalletUtils.swift │ │ ├── WalletWordCheckScreen.swift │ │ └── WalletWordDisplayScreen.swift │ └── WalletImages.xcassets │ │ ├── Contents.json │ │ └── Wallet │ │ ├── BalanceGem.imageset │ │ ├── Contents.json │ │ └── gem.pdf │ │ ├── CameraFlashIcon.imageset │ │ ├── Contents.json │ │ └── ic_flash.pdf │ │ ├── CameraGalleryIcon.imageset │ │ ├── Contents.json │ │ └── ic_gallery (3).pdf │ │ ├── ClearInput.imageset │ │ ├── Clear.pdf │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── DisclosureArrow.imageset │ │ ├── Contents.json │ │ └── ic_open.pdf │ │ ├── DuckIcon.imageset │ │ ├── Contents.json │ │ └── duck.pdf │ │ ├── EncryptedComment.imageset │ │ ├── Contents.json │ │ └── ic_encrypted.pdf │ │ ├── NavigationSettingsIcon.imageset │ │ ├── Contents.json │ │ └── NavigationSettingsIcon.pdf │ │ ├── NavigationShare.imageset │ │ ├── Contents.json │ │ └── ic_share.pdf │ │ ├── NavigationShareIcon.imageset │ │ ├── Contents.json │ │ └── ic_share.pdf │ │ ├── QrGem.imageset │ │ ├── Contents.json │ │ ├── QrGem@2x.png │ │ └── QrGem@3x.png │ │ ├── QrIcon.imageset │ │ ├── Contents.json │ │ └── ic_qrcode.pdf │ │ ├── ReceiveButtonIcon.imageset │ │ ├── Contents.json │ │ └── Group2.pdf │ │ ├── RefreshIcon.imageset │ │ ├── Contents.json │ │ └── ic_walletupdate.pdf │ │ ├── SendButtonIcon.imageset │ │ ├── Contents.json │ │ └── Group.pdf │ │ ├── SplashCornerL.imageset │ │ ├── Contents.json │ │ └── TopLeft.pdf │ │ ├── SplashCornerR.imageset │ │ ├── Contents.json │ │ └── TopRight.pdf │ │ └── TransactionGem.imageset │ │ ├── Contents.json │ │ └── SmallGem.pdf ├── WalletUrl │ ├── BUILD │ └── Sources │ │ └── WalletUrl.swift ├── YuvConversion │ ├── BUILD │ ├── PublicHeaders │ │ └── YuvConversion │ │ │ └── YUV.h │ └── Sources │ │ └── YUV.m ├── openssl │ ├── BUILD │ ├── build-openssl-bazel.sh │ ├── openssl-1.1.1d.tar.gz │ ├── patch-conf.patch │ └── patch-include.patch ├── rlottie │ ├── BUILD │ ├── LottieInstance.mm │ ├── PublicHeaders │ │ └── RLottieBinding │ │ │ └── LottieInstance.h │ ├── config.h │ └── rlottie │ │ ├── inc │ │ ├── rlottie.h │ │ ├── rlottie_capi.h │ │ └── rlottiecommon.h │ │ └── src │ │ ├── binding │ │ └── c │ │ │ └── lottieanimation_capi.cpp │ │ ├── lottie │ │ ├── lottieanimation.cpp │ │ ├── lottieitem.cpp │ │ ├── lottieitem.h │ │ ├── lottiekeypath.cpp │ │ ├── lottiekeypath.h │ │ ├── lottieloader.cpp │ │ ├── lottieloader.h │ │ ├── lottiemodel.cpp │ │ ├── lottiemodel.h │ │ ├── lottieparser.cpp │ │ ├── lottieparser.h │ │ ├── lottieproxymodel.cpp │ │ ├── lottieproxymodel.h │ │ └── rapidjson │ │ │ ├── allocators.h │ │ │ ├── cursorstreamwrapper.h │ │ │ ├── document.h │ │ │ ├── encodedstream.h │ │ │ ├── encodings.h │ │ │ ├── error │ │ │ ├── en.h │ │ │ └── error.h │ │ │ ├── filereadstream.h │ │ │ ├── filewritestream.h │ │ │ ├── fwd.h │ │ │ ├── internal │ │ │ ├── biginteger.h │ │ │ ├── diyfp.h │ │ │ ├── dtoa.h │ │ │ ├── ieee754.h │ │ │ ├── itoa.h │ │ │ ├── meta.h │ │ │ ├── pow10.h │ │ │ ├── regex.h │ │ │ ├── stack.h │ │ │ ├── strfunc.h │ │ │ ├── strtod.h │ │ │ └── swap.h │ │ │ ├── istreamwrapper.h │ │ │ ├── memorybuffer.h │ │ │ ├── memorystream.h │ │ │ ├── ostreamwrapper.h │ │ │ ├── pointer.h │ │ │ ├── prettywriter.h │ │ │ ├── rapidjson.h │ │ │ ├── reader.h │ │ │ ├── schema.h │ │ │ ├── stream.h │ │ │ ├── stringbuffer.h │ │ │ └── writer.h │ │ └── vector │ │ ├── freetype │ │ ├── v_ft_math.cpp │ │ ├── v_ft_math.h │ │ ├── v_ft_raster.cpp │ │ ├── v_ft_raster.h │ │ ├── v_ft_stroker.cpp │ │ ├── v_ft_stroker.h │ │ └── v_ft_types.h │ │ ├── pixman │ │ ├── pixman-arm-neon-asm.h │ │ ├── vregion.cpp │ │ └── vregion.h │ │ ├── vbezier.cpp │ │ ├── vbezier.h │ │ ├── vbitmap.cpp │ │ ├── vbitmap.h │ │ ├── vbrush.cpp │ │ ├── vbrush.h │ │ ├── vcompositionfunctions.cpp │ │ ├── vcowptr.h │ │ ├── vdasher.cpp │ │ ├── vdasher.h │ │ ├── vdebug.cpp │ │ ├── vdebug.h │ │ ├── vdrawable.cpp │ │ ├── vdrawable.h │ │ ├── vdrawhelper.cpp │ │ ├── vdrawhelper.h │ │ ├── vdrawhelper_sse2.cpp │ │ ├── velapsedtimer.cpp │ │ ├── velapsedtimer.h │ │ ├── vglobal.h │ │ ├── vimageloader.cpp │ │ ├── vimageloader.h │ │ ├── vinterpolator.cpp │ │ ├── vinterpolator.h │ │ ├── vline.h │ │ ├── vmatrix.cpp │ │ ├── vmatrix.h │ │ ├── vpainter.cpp │ │ ├── vpainter.h │ │ ├── vpath.cpp │ │ ├── vpath.h │ │ ├── vpathmesure.cpp │ │ ├── vpathmesure.h │ │ ├── vpoint.h │ │ ├── vraster.cpp │ │ ├── vraster.h │ │ ├── vrect.cpp │ │ ├── vrect.h │ │ ├── vrle.cpp │ │ ├── vrle.h │ │ ├── vstackallocator.h │ │ └── vtaskqueue.h └── ton │ ├── Apple-bazel.cmake │ ├── BUILD │ ├── build-ton-bazel.sh │ ├── headers.patch │ └── iOS-bazel.cmake ├── third-party └── cmake │ ├── BUILD │ └── cmake-3.16.0.tar.gz └── wallet_env.sh /.bazelrc: -------------------------------------------------------------------------------- 1 | build --experimental_guard_against_concurrent_changes 2 | build --action_env=ZERO_AR_DATE=1 3 | 4 | build --strategy=Genrule=local 5 | build --apple_platform_type=ios 6 | build --cxxopt='-std=c++14' 7 | build --copt='-w' 8 | build --swiftcopt='-Xcc' 9 | build --swiftcopt='-w' 10 | build --spawn_strategy=local 11 | build --strategy=SwiftCompile=local 12 | build --features=debug_prefix_map_pwd_is_dot 13 | build --features=swift.cacheable_swiftmodules 14 | build --features=swift.debug_prefix_map 15 | 16 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "build-system/tulsi"] 2 | path = build-system/tulsi 3 | url = https://github.com/bazelbuild/tulsi.git 4 | [submodule "build-system/bazel-rules/rules_apple"] 5 | path = build-system/bazel-rules/rules_apple 6 | url = https://github.com/bazelbuild/rules_apple.git 7 | [submodule "build-system/bazel-rules/rules_swift"] 8 | path = build-system/bazel-rules/rules_swift 9 | url = https://github.com/bazelbuild/rules_swift.git 10 | [submodule "build-system/bazel-rules/apple_support"] 11 | path = build-system/bazel-rules/apple_support 12 | url = https://github.com/bazelbuild/apple_support.git 13 | [submodule "submodules/ton/tonlib-src"] 14 | path = submodules/ton/tonlib-src 15 | url = https://github.com/ton-blockchain/ton.git 16 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | APP_VERSION="1.0" 2 | CORE_COUNT=$(shell sysctl -n hw.logicalcpu) 3 | CORE_COUNT_MINUS_ONE=$(shell expr ${CORE_COUNT} \- 1) 4 | 5 | BAZEL=$(shell which bazel) 6 | 7 | ifneq ($(BAZEL_CACHE_DIR),) 8 | export BAZEL_CACHE_FLAGS=\ 9 | --disk_cache="${BAZEL_CACHE_DIR}" 10 | endif 11 | 12 | BAZEL_COMMON_FLAGS=\ 13 | --announce_rc \ 14 | --features=swift.use_global_module_cache \ 15 | 16 | BAZEL_DEBUG_FLAGS=\ 17 | --features=swift.enable_batch_mode \ 18 | --swiftcopt=-j${CORE_COUNT_MINUS_ONE} \ 19 | 20 | BAZEL_OPT_FLAGS=\ 21 | --swiftcopt=-whole-module-optimization \ 22 | --swiftcopt='-num-threads' --swiftcopt='16' \ 23 | 24 | kill_xcode: 25 | killall Xcode || true 26 | 27 | wallet_app_debug_arm64: 28 | WALLET_APP_VERSION="${APP_VERSION}" \ 29 | build-system/prepare-build.sh Wallet distribution 30 | "${BAZEL}" build Wallet/Wallet ${BAZEL_CACHE_FLAGS} ${BAZEL_COMMON_FLAGS} ${BAZEL_DEBUG_FLAGS} \ 31 | -c dbg \ 32 | --ios_multi_cpus=arm64 \ 33 | --watchos_cpus=armv7k,arm64_32 \ 34 | --verbose_failures 35 | 36 | wallet_app: 37 | WALLET_APP_VERSION="${APP_VERSION}" \ 38 | build-system/prepare-build.sh Wallet distribution 39 | "${BAZEL}" build Wallet/Wallet ${BAZEL_CACHE_FLAGS} ${BAZEL_COMMON_FLAGS} ${BAZEL_OPT_FLAGS} \ 40 | -c opt \ 41 | --ios_multi_cpus=armv7,arm64 \ 42 | --watchos_cpus=armv7k,arm64_32 \ 43 | --verbose_failures 44 | 45 | bazel_wallet_prepare_development_build: 46 | WALLET_APP_VERSION="${APP_VERSION}" \ 47 | BAZEL_CACHE_DIR="${BAZEL_CACHE_DIR}" \ 48 | build-system/prepare-build.sh Wallet development 49 | 50 | wallet_project: kill_xcode bazel_wallet_prepare_development_build 51 | WALLET_APP_VERSION="${APP_VERSION}" \ 52 | BAZEL_CACHE_DIR="${BAZEL_CACHE_DIR}" \ 53 | build-system/generate-xcode-project.sh Wallet 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Toncoin Wallet (iOS) 2 | 3 | This is the source code and build instructions for a Toncoin Wallet implementation for iOS. 4 | 5 | 1. Install Xcode 14.3.1 6 | 7 | ``` 8 | https://apps.apple.com/app/xcode/id497799835 9 | ``` 10 | 11 | Make sure to launch Xcode at least once and set up command-line tools paths (Xcode — Preferences — Locations — Command Line Tools) 12 | 13 | 2. Install Bazel 5.4.0 14 | 15 | ``` 16 | brew install build-system/bazel.rb 17 | ``` 18 | 19 | 2. Install OpenSSL 1.1 20 | 21 | ``` 22 | brew install openssl@1.1 23 | ``` 24 | 25 | 3. Install pkg-config 26 | 27 | ``` 28 | brew install pkg-config 29 | ``` 30 | 31 | 4. Generate Xcode project 32 | 33 | Note: 34 | It is recommended to use an artifact cache to optimize build speed. Prepend any of the following commands with 35 | 36 | ``` 37 | export BAZEL_CACHE_DIR="path/to/existing/directory" 38 | ``` 39 | 40 | ``` 41 | sh wallet_env.sh make wallet_project 42 | ``` 43 | -------------------------------------------------------------------------------- /WORKSPACE: -------------------------------------------------------------------------------- 1 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 2 | 3 | http_archive( 4 | name = "com_google_protobuf", 5 | urls = ["https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.17.1.zip"], 6 | sha256 = "932412529daf7e8a1edf1d5ccce6828537bcc4dd0223a9aa26cf0752683f7836", 7 | strip_prefix = "protobuf-3.17.1", 8 | type = "zip", 9 | ) 10 | 11 | load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") 12 | protobuf_deps() 13 | 14 | local_repository( 15 | name = "build_bazel_rules_apple", 16 | path = "build-system/bazel-rules/rules_apple", 17 | ) 18 | 19 | local_repository( 20 | name = "build_bazel_rules_swift", 21 | path = "build-system/bazel-rules/rules_swift", 22 | ) 23 | 24 | local_repository( 25 | name = "build_bazel_apple_support", 26 | path = "build-system/bazel-rules/apple_support", 27 | ) 28 | 29 | load( 30 | "@build_bazel_rules_apple//apple:repositories.bzl", 31 | "apple_rules_dependencies", 32 | ) 33 | 34 | apple_rules_dependencies() 35 | 36 | load( 37 | "@build_bazel_rules_swift//swift:repositories.bzl", 38 | "swift_rules_dependencies", 39 | ) 40 | 41 | swift_rules_dependencies() 42 | 43 | load( 44 | "@build_bazel_apple_support//lib:repositories.bzl", 45 | "apple_support_dependencies", 46 | ) 47 | 48 | apple_support_dependencies() 49 | 50 | load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") 51 | 52 | bazel_skylib_workspace() 53 | -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon-iTunesArtwork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon-iTunesArtwork.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@120x120-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@120x120-1.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@120x120.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@152x152.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@167x167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@167x167.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@180x180.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@20x20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@20x20.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@29x29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@29x29.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@40x40-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@40x40-1.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@40x40-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@40x40-2.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@40x40.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@58x58-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@58x58-1.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@58x58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@58x58.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@60x60.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@76x76.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@80x80-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@80x80-1.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@80x80.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@87x87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/Wallet/Icons.xcassets/AppIconWallet.appiconset/GramIcon@87x87.png -------------------------------------------------------------------------------- /Wallet/Icons.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Wallet/Sources/Application.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | @objc(Application) class Application: UIApplication { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /Wallet/Sources/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | int main(int argc, char *argv[]) { 4 | @autoreleasepool { 5 | return UIApplicationMain(argc, argv, @"Application", @"AppDelegate"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /build-system/bazel-utils/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/build-system/bazel-utils/BUILD -------------------------------------------------------------------------------- /build-system/bazel-utils/plist_fragment.bzl: -------------------------------------------------------------------------------- 1 | 2 | def _plist_fragment(ctx): 3 | output = ctx.outputs.out 4 | 5 | found_keys = list() 6 | template = ctx.attr.template 7 | current_start = 0 8 | for i in range(len(template)): 9 | start_index = template.find("{", current_start) 10 | if start_index == -1: 11 | break 12 | end_index = template.find("}", start_index + 1) 13 | if end_index == -1: 14 | fail("Could not find the matching '}' for the '{' at {}".format(start_index)) 15 | found_keys.append(template[start_index + 1:end_index]) 16 | current_start = end_index + 1 17 | 18 | resolved_values = dict() 19 | for key in found_keys: 20 | value = ctx.var.get(key, None) 21 | if value == None: 22 | fail("Expected value for --define={} was not found".format(key)) 23 | resolved_values[key] = value 24 | 25 | plist_string = """ 26 | 27 | 28 | 29 | 30 | """ + template.format(**resolved_values) + """ 31 | 32 | 33 | """ 34 | 35 | ctx.actions.write( 36 | output = output, 37 | content = plist_string, 38 | ) 39 | 40 | plist_fragment = rule( 41 | implementation = _plist_fragment, 42 | attrs = { 43 | "extension": attr.string(mandatory = True), 44 | "template": attr.string(mandatory = True), 45 | }, 46 | outputs = { 47 | "out": "%{name}.%{extension}" 48 | }, 49 | ) 50 | -------------------------------------------------------------------------------- /build-system/bazel_version: -------------------------------------------------------------------------------- 1 | 5.4.0-homebrew 2 | -------------------------------------------------------------------------------- /build-system/prepare-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | APP_TARGET="$1" 6 | if [ "$APP_TARGET" == "" ]; then 7 | echo "Usage: sh prepare-build.sh app_target development|distribution" 8 | exit 1 9 | fi 10 | 11 | BUILD_TYPE="$2" 12 | case "$BUILD_TYPE" in 13 | development) 14 | PROFILES_TYPE="development" 15 | ;; 16 | distribution) 17 | PROFILES_TYPE="distribution" 18 | ;; 19 | *) 20 | echo "Unknown build provisioning type: $BUILD_TYPE" 21 | exit 1 22 | ;; 23 | esac 24 | 25 | BASE_PATH=$(dirname $0) 26 | 27 | COPY_PROVISIONING_PROFILES_SCRIPT="$BASE_PATH/copy-provisioning-profiles-$APP_TARGET.sh" 28 | PREPARE_BUILD_VARIABLES_SCRIPT="$BASE_PATH/prepare-build-variables-$APP_TARGET.sh" 29 | 30 | if [ ! -f "$COPY_PROVISIONING_PROFILES_SCRIPT" ]; then 31 | echo "$COPY_PROVISIONING_PROFILES_SCRIPT not found" 32 | exit 1 33 | fi 34 | 35 | if [ ! -f "$PREPARE_BUILD_VARIABLES_SCRIPT" ]; then 36 | echo "$PREPARE_BUILD_VARIABLES_SCRIPT not found" 37 | exit 1 38 | fi 39 | 40 | DATA_DIRECTORY="build-input/data" 41 | rm -rf "$DATA_DIRECTORY" 42 | mkdir -p "$DATA_DIRECTORY" 43 | touch "$DATA_DIRECTORY/BUILD" 44 | 45 | source "$COPY_PROVISIONING_PROFILES_SCRIPT" 46 | source "$PREPARE_BUILD_VARIABLES_SCRIPT" 47 | 48 | echo "Copying provisioning profiles..." 49 | copy_provisioning_profiles "$PROFILES_TYPE" 50 | 51 | echo "Preparing build variables..." 52 | prepare_build_variables "$BUILD_TYPE" 53 | -------------------------------------------------------------------------------- /build-system/xcode_version: -------------------------------------------------------------------------------- 1 | 14.3.1 2 | -------------------------------------------------------------------------------- /submodules/ActivityIndicator/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "ActivityIndicator", 5 | module_name = "ActivityIndicator", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | deps = [ 10 | "//submodules/Display:Display", 11 | "//submodules/AsyncDisplayKit:AsyncDisplayKit", 12 | ], 13 | visibility = [ 14 | "//visibility:public", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /submodules/AlertUI/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "AlertUI", 5 | module_name = "AlertUI", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | deps = [ 10 | "//submodules/Display:Display", 11 | ], 12 | visibility = [ 13 | "//visibility:public", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /submodules/AnimatedStickerNode/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "AnimatedStickerNode", 5 | module_name = "AnimatedStickerNode", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | deps = [ 10 | "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit", 11 | "//submodules/AsyncDisplayKit:AsyncDisplayKit", 12 | "//submodules/Display:Display", 13 | "//submodules/YuvConversion:YuvConversion", 14 | "//submodules/GZip:GZip", 15 | "//submodules/rlottie:RLottieBinding", 16 | ], 17 | visibility = [ 18 | "//visibility:public", 19 | ], 20 | ) 21 | -------------------------------------------------------------------------------- /submodules/AnimatedStickerNode/Sources/AnimationRenderer.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import SwiftSignalKit 3 | import AsyncDisplayKit 4 | 5 | enum AnimationRendererFrameType { 6 | case argb 7 | case yuva 8 | } 9 | 10 | protocol AnimationRenderer { 11 | func render(queue: Queue, width: Int, height: Int, bytesPerRow: Int, data: Data, type: AnimationRendererFrameType, completion: @escaping () -> Void) 12 | } 13 | -------------------------------------------------------------------------------- /submodules/AnimatedStickerNode/Sources/SoftwareAnimationRenderer.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | import Display 5 | import SwiftSignalKit 6 | import YuvConversion 7 | 8 | final class SoftwareAnimationRenderer: ASDisplayNode, AnimationRenderer { 9 | func render(queue: Queue, width: Int, height: Int, bytesPerRow: Int, data: Data, type: AnimationRendererFrameType, completion: @escaping () -> Void) { 10 | queue.async { [weak self] in 11 | let calculatedBytesPerRow = (4 * Int(width) + 15) & (~15) 12 | assert(bytesPerRow == calculatedBytesPerRow) 13 | 14 | let image = generateImagePixel(CGSize(width: CGFloat(width), height: CGFloat(height)), scale: 1.0, pixelGenerator: { _, pixelData, bytesPerRow in 15 | switch type { 16 | case .yuva: 17 | data.withUnsafeBytes { (bytes: UnsafePointer) -> Void in 18 | decodeYUVAToRGBA(bytes, pixelData, Int32(width), Int32(height), Int32(bytesPerRow)) 19 | } 20 | case .argb: 21 | data.withUnsafeBytes { (bytes: UnsafePointer) -> Void in 22 | memcpy(pixelData, bytes, data.count) 23 | } 24 | } 25 | }) 26 | 27 | Queue.mainQueue().async { 28 | self?.contents = image?.cgImage 29 | completion() 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /submodules/AppBundle/BUILD: -------------------------------------------------------------------------------- 1 | 2 | objc_library( 3 | name = "AppBundle", 4 | module_name = "AppBundle", 5 | enable_modules = True, 6 | srcs = glob([ 7 | "Sources/**/*.m", 8 | "Sources/**/*.h", 9 | ]), 10 | hdrs = glob([ 11 | "PublicHeaders/**/*.h", 12 | ]), 13 | includes = [ 14 | "PublicHeaders", 15 | ], 16 | sdk_frameworks = [ 17 | "Foundation", 18 | "UIKit", 19 | ], 20 | visibility = [ 21 | "//visibility:public", 22 | ], 23 | ) 24 | -------------------------------------------------------------------------------- /submodules/AppBundle/PublicHeaders/AppBundle/AppBundle.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | NSBundle * _Nonnull getAppBundle(void); 5 | 6 | @interface UIImage (AppBundle) 7 | 8 | - (instancetype _Nullable)initWithBundleImageName:(NSString * _Nonnull)bundleImageName; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /submodules/AppBundle/Sources/AppBundle/AppBundle.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | NSBundle * _Nonnull getAppBundle() { 4 | NSBundle *bundle = [NSBundle mainBundle]; 5 | if ([[bundle.bundleURL pathExtension] isEqualToString:@"appex"]) { 6 | bundle = [NSBundle bundleWithURL:[[bundle.bundleURL URLByDeletingLastPathComponent] URLByDeletingLastPathComponent]]; 7 | } else if ([[bundle.bundleURL pathExtension] isEqualToString:@"framework"]) { 8 | bundle = [NSBundle bundleWithURL:[[bundle.bundleURL URLByDeletingLastPathComponent] URLByDeletingLastPathComponent]]; 9 | } else if ([[bundle.bundleURL pathExtension] isEqualToString:@"Frameworks"]) { 10 | bundle = [NSBundle bundleWithURL:[bundle.bundleURL URLByDeletingLastPathComponent]]; 11 | } 12 | return bundle; 13 | } 14 | 15 | @implementation UIImage (AppBundle) 16 | 17 | - (instancetype _Nullable)initWithBundleImageName:(NSString * _Nonnull)bundleImageName { 18 | return [UIImage imageNamed:bundleImageName inBundle:getAppBundle() compatibleWithTraitCollection:nil]; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/BUILD: -------------------------------------------------------------------------------- 1 | public_headers = glob([ 2 | "Source/PublicHeaders/AsyncDisplayKit/*.h", 3 | ]) 4 | 5 | private_headers = glob([ 6 | "Source/*.h", 7 | ]) 8 | 9 | objc_library( 10 | name = "AsyncDisplayKit", 11 | enable_modules = True, 12 | module_name = "AsyncDisplayKit", 13 | srcs = glob([ 14 | "Source/**/*.m", 15 | "Source/**/*.mm", 16 | ]) + private_headers, 17 | hdrs = public_headers, 18 | defines = [ 19 | "MINIMAL_ASDK", 20 | ], 21 | includes = [ 22 | "Source/PublicHeaders", 23 | ], 24 | sdk_frameworks = [ 25 | "Foundation", 26 | "UIKit", 27 | "QuartzCore", 28 | "CoreMedia", 29 | "CoreText", 30 | "CoreGraphics", 31 | ], 32 | visibility = [ 33 | "//visibility:public", 34 | ], 35 | ) 36 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASAbstractLayoutController+FrameworkPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASAbstractLayoutController+FrameworkPrivate.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | // 11 | // The following methods are ONLY for use by _ASDisplayLayer, _ASDisplayView, and ASDisplayNode. 12 | // These methods must never be called or overridden by other classes. 13 | // 14 | 15 | #include 16 | 17 | @interface ASAbstractLayoutController (FrameworkPrivate) 18 | 19 | + (std::vector>)defaultTuningParameters; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASCGImageBuffer.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASCGImageBuffer.h 3 | // Texture 4 | // 5 | // Copyright (c) Pinterest, Inc. All rights reserved. 6 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | AS_SUBCLASSING_RESTRICTED 16 | @interface ASCGImageBuffer : NSObject 17 | 18 | /// Init a zero-filled buffer with the given length. 19 | - (instancetype)initWithLength:(NSUInteger)length; 20 | 21 | @property (readonly) void *mutableBytes NS_RETURNS_INNER_POINTER; 22 | 23 | /// Don't do any drawing or call any methods after calling this. 24 | - (CGDataProviderRef)createDataProviderAndInvalidate CF_RETURNS_RETAINED; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASControlNode+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASControlNode+Private.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | 12 | @interface ASControlNode (Private) 13 | 14 | #if TARGET_OS_TV 15 | - (void)_pressDown; 16 | #endif 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASControlTargetAction.mm: -------------------------------------------------------------------------------- 1 | // 2 | // ASControlTargetAction.mm 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | 12 | @implementation ASControlTargetAction 13 | { 14 | __weak id _target; 15 | BOOL _createdWithNoTarget; 16 | } 17 | 18 | - (void)setTarget:(id)target { 19 | _target = target; 20 | 21 | if (!target) { 22 | _createdWithNoTarget = YES; 23 | } 24 | } 25 | 26 | - (id)target { 27 | return _target; 28 | } 29 | 30 | - (BOOL)isEqual:(id)object { 31 | if (![object isKindOfClass:[ASControlTargetAction class]]) { 32 | return NO; 33 | } 34 | 35 | ASControlTargetAction *otherObject = (ASControlTargetAction *)object; 36 | 37 | BOOL areTargetsEqual; 38 | 39 | if (self.target != nil && otherObject.target != nil && self.target == otherObject.target) { 40 | areTargetsEqual = YES; 41 | } 42 | else if (self.target == nil && otherObject.target == nil && self.createdWithNoTarget && otherObject.createdWithNoTarget) { 43 | areTargetsEqual = YES; 44 | } 45 | else { 46 | areTargetsEqual = NO; 47 | } 48 | 49 | if (!areTargetsEqual) { 50 | return NO; 51 | } 52 | 53 | if (self.action && otherObject.action && self.action == otherObject.action) { 54 | return YES; 55 | } 56 | else { 57 | return NO; 58 | } 59 | } 60 | 61 | - (NSUInteger)hash { 62 | return [self.target hash]; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASDispatch.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASDispatch.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | 13 | /** 14 | * Like dispatch_apply, but you can set the thread count. 0 means 2*active CPUs. 15 | * 16 | * Note: The actual number of threads may be lower than threadCount, if libdispatch 17 | * decides the system can't handle it. In reality this rarely happens. 18 | */ 19 | AS_EXTERN void ASDispatchApply(size_t iterationCount, dispatch_queue_t queue, NSUInteger threadCount, NS_NOESCAPE void(^work)(size_t i)); 20 | 21 | /** 22 | * Like dispatch_async, but you can set the thread count. 0 means 2*active CPUs. 23 | * 24 | * Note: The actual number of threads may be lower than threadCount, if libdispatch 25 | * decides the system can't handle it. In reality this rarely happens. 26 | */ 27 | AS_EXTERN void ASDispatchAsync(size_t iterationCount, dispatch_queue_t queue, NSUInteger threadCount, NS_NOESCAPE void(^work)(size_t i)); 28 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASDisplayNode+Convenience.mm: -------------------------------------------------------------------------------- 1 | // 2 | // ASDisplayNode+Convenience.mm 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | 12 | #import 13 | 14 | #import 15 | #import "ASResponderChainEnumerator.h" 16 | 17 | @implementation ASDisplayNode (Convenience) 18 | 19 | - (__kindof UIViewController *)closestViewController 20 | { 21 | ASDisplayNodeAssertMainThread(); 22 | 23 | // Careful not to trigger node loading here. 24 | if (!self.nodeLoaded) { 25 | return nil; 26 | } 27 | 28 | // Get the closest view. 29 | UIView *view = ASFindClosestViewOfLayer(self.layer); 30 | // Travel up the responder chain to find a view controller. 31 | for (UIResponder *responder in [view asdk_responderChainEnumerator]) { 32 | UIViewController *vc = ASDynamicCast(responder, UIViewController); 33 | if (vc != nil) { 34 | return vc; 35 | } 36 | } 37 | return nil; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASHashing.mm: -------------------------------------------------------------------------------- 1 | // 2 | // ASHashing.mm 3 | // Texture 4 | // 5 | // Copyright (c) Pinterest, Inc. All rights reserved. 6 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | 9 | #import 10 | 11 | #define ELF_STEP(B) T1 = (H << 4) + B; T2 = T1 & 0xF0000000; if (T2) T1 ^= (T2 >> 24); T1 &= (~T2); H = T1; 12 | 13 | /** 14 | * The hashing algorithm copied from CoreFoundation CFHashBytes function. 15 | * https://opensource.apple.com/source/CF/CF-1153.18/CFUtilities.c.auto.html 16 | */ 17 | NSUInteger ASHashBytes(void *bytesarg, size_t length) { 18 | /* The ELF hash algorithm, used in the ELF object file format */ 19 | uint8_t *bytes = (uint8_t *)bytesarg; 20 | UInt32 H = 0, T1, T2; 21 | SInt32 rem = (SInt32)length; 22 | while (3 < rem) { 23 | ELF_STEP(bytes[length - rem]); 24 | ELF_STEP(bytes[length - rem + 1]); 25 | ELF_STEP(bytes[length - rem + 2]); 26 | ELF_STEP(bytes[length - rem + 3]); 27 | rem -= 4; 28 | } 29 | switch (rem) { 30 | case 3: ELF_STEP(bytes[length - 3]); 31 | case 2: ELF_STEP(bytes[length - 2]); 32 | case 1: ELF_STEP(bytes[length - 1]); 33 | case 0: ; 34 | } 35 | return H; 36 | } 37 | 38 | #undef ELF_STEP 39 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASLayoutElementStylePrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutElementStylePrivate.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #pragma once 11 | 12 | #import 13 | #import 14 | 15 | @interface ASLayoutElementStyle () 16 | 17 | /** 18 | * @abstract The object that acts as the delegate of the style. 19 | * 20 | * @discussion The delegate must adopt the ASLayoutElementStyleDelegate protocol. The delegate is not retained. 21 | */ 22 | @property (nullable, nonatomic, weak) id delegate; 23 | 24 | /** 25 | * @abstract A size constraint that should apply to this ASLayoutElement. 26 | */ 27 | @property (nonatomic, readonly) ASLayoutElementSize size; 28 | 29 | @property (nonatomic, assign) ASStackLayoutAlignItems parentAlignStyle; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASLayoutManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutManager.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | 13 | AS_SUBCLASSING_RESTRICTED 14 | @interface ASLayoutManager : NSLayoutManager 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASLayoutManager.mm: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutManager.mm 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import "ASLayoutManager.h" 11 | 12 | @implementation ASLayoutManager 13 | 14 | - (void)showCGGlyphs:(const CGGlyph *)glyphs 15 | positions:(const CGPoint *)positions 16 | count:(NSUInteger)glyphCount 17 | font:(UIFont *)font 18 | matrix:(CGAffineTransform)textMatrix 19 | attributes:(NSDictionary *)attributes 20 | inContext:(CGContextRef)graphicsContext 21 | { 22 | 23 | // NSLayoutManager has a hard coded internal color for hyperlinks which ignores 24 | // NSForegroundColorAttributeName. To get around this, we force the fill color 25 | // in the current context to match NSForegroundColorAttributeName. 26 | UIColor *foregroundColor = attributes[NSForegroundColorAttributeName]; 27 | 28 | if (foregroundColor) 29 | { 30 | CGContextSetFillColorWithColor(graphicsContext, foregroundColor.CGColor); 31 | } 32 | 33 | [super showCGGlyphs:glyphs 34 | positions:positions 35 | count:glyphCount 36 | font:font 37 | matrix:textMatrix 38 | attributes:attributes 39 | inContext:graphicsContext]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASLayoutSpecPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutSpecPrivate.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | 13 | #if DEBUG 14 | #define AS_DEDUPE_LAYOUT_SPEC_TREE 1 15 | #else 16 | #define AS_DEDUPE_LAYOUT_SPEC_TREE 0 17 | #endif 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | @interface ASLayoutSpec() { 22 | AS::RecursiveMutex __instanceLock__; 23 | std::atomic _primitiveTraitCollection; 24 | ASLayoutElementStyle *_style; 25 | NSMutableArray *_childrenArray; 26 | } 27 | 28 | #if AS_DEDUPE_LAYOUT_SPEC_TREE 29 | /** 30 | * Recursively search the subtree for elements that occur more than once. 31 | */ 32 | - (nullable NSHashTable> *)findDuplicatedElementsInSubtree; 33 | #endif 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASMainSerialQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASMainSerialQueue.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | 13 | AS_SUBCLASSING_RESTRICTED 14 | @interface ASMainSerialQueue : NSObject 15 | 16 | @property (nonatomic, readonly) NSUInteger numberOfScheduledBlocks; 17 | - (void)performBlockOnMainThread:(dispatch_block_t)block; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASPendingStateController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASPendingStateController.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | 13 | @class ASDisplayNode; 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | /** 18 | A singleton that is responsible for applying changes to 19 | UIView/CALayer properties of display nodes when they 20 | have been set on background threads. 21 | 22 | This controller will enqueue run-loop events to flush changes 23 | but if you need them flushed now you can call `flush` from the main thread. 24 | */ 25 | AS_SUBCLASSING_RESTRICTED 26 | @interface ASPendingStateController : NSObject 27 | 28 | + (ASPendingStateController *)sharedInstance; 29 | 30 | @property (nonatomic, readonly) BOOL hasChanges; 31 | 32 | /** 33 | Flush all pending states for nodes now. Any UIView/CALayer properties 34 | that have been set in the background will be applied to their 35 | corresponding views/layers before this method returns. 36 | 37 | You must call this method on the main thread. 38 | */ 39 | - (void)flush; 40 | 41 | /** 42 | Register this node as having pending state that needs to be copied 43 | over to the view/layer. This is called automatically by display nodes 44 | when their view/layer properties are set post-load on background threads. 45 | */ 46 | - (void)registerNode:(ASDisplayNode *)node; 47 | 48 | @end 49 | 50 | NS_ASSUME_NONNULL_END 51 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASResponderChainEnumerator.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASResponderChainEnumerator.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | AS_SUBCLASSING_RESTRICTED 16 | @interface ASResponderChainEnumerator : NSEnumerator 17 | 18 | - (instancetype)initWithResponder:(UIResponder *)responder; 19 | 20 | @end 21 | 22 | @interface UIResponder (ASResponderChainEnumerator) 23 | 24 | - (ASResponderChainEnumerator *)asdk_responderChainEnumerator; 25 | 26 | @end 27 | 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASResponderChainEnumerator.mm: -------------------------------------------------------------------------------- 1 | // 2 | // ASResponderChainEnumerator.mm 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import "ASResponderChainEnumerator.h" 11 | #import 12 | 13 | @implementation ASResponderChainEnumerator { 14 | UIResponder *_currentResponder; 15 | } 16 | 17 | - (instancetype)initWithResponder:(UIResponder *)responder 18 | { 19 | ASDisplayNodeAssertMainThread(); 20 | if (self = [super init]) { 21 | _currentResponder = responder; 22 | } 23 | return self; 24 | } 25 | 26 | #pragma mark - NSEnumerator 27 | 28 | - (id)nextObject 29 | { 30 | ASDisplayNodeAssertMainThread(); 31 | id result = [_currentResponder nextResponder]; 32 | _currentResponder = result; 33 | return result; 34 | } 35 | 36 | @end 37 | 38 | @implementation UIResponder (ASResponderChainEnumerator) 39 | 40 | - (NSEnumerator *)asdk_responderChainEnumerator 41 | { 42 | return [[ASResponderChainEnumerator alloc] initWithResponder:self]; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASTextNodeCommon.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASTextNodeCommon.h 3 | // Texture 4 | // 5 | // Copyright (c) Pinterest, Inc. All rights reserved. 6 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | 9 | #import 10 | 11 | #import 12 | 13 | #define AS_TEXT_ALERT_UNIMPLEMENTED_FEATURE() { \ 14 | static dispatch_once_t onceToken; \ 15 | dispatch_once(&onceToken, ^{ \ 16 | NSLog(@"[Texture] Warning: Feature %@ is unimplemented in %@.", NSStringFromSelector(_cmd), NSStringFromClass(self.class)); \ 17 | });\ 18 | } 19 | 20 | /** 21 | * Highlight styles. 22 | */ 23 | typedef NS_ENUM(NSUInteger, ASTextNodeHighlightStyle) { 24 | /** 25 | * Highlight style for text on a light background. 26 | */ 27 | ASTextNodeHighlightStyleLight, 28 | 29 | /** 30 | * Highlight style for text on a dark background. 31 | */ 32 | ASTextNodeHighlightStyleDark 33 | }; 34 | 35 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/ASWeakProxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASWeakProxy.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | 13 | AS_SUBCLASSING_RESTRICTED 14 | @interface ASWeakProxy : NSProxy 15 | 16 | /** 17 | * @return target The target which will be forwarded all messages sent to the weak proxy. 18 | */ 19 | @property (nonatomic, weak, readonly) id target; 20 | 21 | /** 22 | * An object which forwards messages to a target which it weakly references 23 | * 24 | * @discussion This class is useful for breaking retain cycles. You can pass this in place 25 | * of the target to something which creates a strong reference. All messages sent to the 26 | * proxy will be passed onto the target. 27 | * 28 | * @return an instance of ASWeakProxy 29 | */ 30 | + (instancetype)weakProxyWithTarget:(id)target NS_RETURNS_RETAINED; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/NSIndexSet+ASHelpers.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSIndexSet+ASHelpers.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | 12 | @interface NSIndexSet (ASHelpers) 13 | 14 | - (NSIndexSet *)as_indexesByMapping:(NSUInteger (^)(NSUInteger idx))block; 15 | 16 | - (NSIndexSet *)as_intersectionWithIndexes:(NSIndexSet *)indexes; 17 | 18 | /// Returns all the item indexes from the given index paths that are in the given section. 19 | + (NSIndexSet *)as_indexSetFromIndexPaths:(NSArray *)indexPaths inSection:(NSUInteger)section; 20 | 21 | /// If you've got an old index, and you insert items using this index set, this returns the change to get to the new index. 22 | - (NSUInteger)as_indexChangeByInsertingItemsBelowIndex:(NSUInteger)index; 23 | 24 | - (NSString *)as_smallDescription; 25 | 26 | /// Returns all the section indexes contained in the index paths array. 27 | + (NSIndexSet *)as_sectionsFromIndexPaths:(NSArray *)indexPaths; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/ASAbsoluteLayoutElement.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASAbsoluteLayoutElement.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | /** 16 | * Layout options that can be defined for an ASLayoutElement being added to a ASAbsoluteLayoutSpec. 17 | */ 18 | @protocol ASAbsoluteLayoutElement 19 | 20 | /** 21 | * @abstract The position of this object within its parent spec. 22 | */ 23 | @property (nonatomic) CGPoint layoutPosition; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/ASBlockTypes.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASBlockTypes.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | 13 | @class ASCellNode; 14 | 15 | /** 16 | * ASCellNode creation block. Used to lazily create the ASCellNode instance for a specified indexPath. 17 | */ 18 | typedef ASCellNode * _Nonnull(^ASCellNodeBlock)(void); 19 | 20 | // Type for the cancellation checker block passed into the async display blocks. YES means the operation has been cancelled, NO means continue. 21 | typedef BOOL(^asdisplaynode_iscancelled_block_t)(void); 22 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/ASCollections.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASCollections.h 3 | // Texture 4 | // 5 | // Copyright (c) Pinterest, Inc. All rights reserved. 6 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface NSArray<__covariant ObjectType> (ASCollections) 15 | 16 | /** 17 | * Create an immutable NSArray from a C-array of strong pointers. 18 | * 19 | * Note: The memory for the array you pass in will be zero'd (to prevent ARC from releasing 20 | * the references when the array goes out of scope.) 21 | * 22 | * Can be combined with vector like: 23 | * vector vec; 24 | * vec.push_back(@"foo"); 25 | * vec.push_back(@"bar"); 26 | * NSArray *arr = [NSArray arrayTransferring:vec.data() count:vec.size()] 27 | * ** vec is now { nil, nil } ** 28 | * 29 | * Unfortunately making a convenience method to do this is currently impossible because 30 | * vector can't be converted to vector by the compiler (silly). 31 | * 32 | * See the private __CFArrayCreateTransfer function. 33 | */ 34 | + (NSArray *)arrayByTransferring:(ObjectType _Nonnull __strong * _Nonnull)pointers 35 | count:(NSUInteger)count NS_RETURNS_RETAINED; 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/ASConfigurationDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASConfigurationDelegate.h 3 | // Texture 4 | // 5 | // Copyright (c) Pinterest, Inc. All rights reserved. 6 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | /** 16 | * Used to communicate configuration-related events to the client. 17 | */ 18 | @protocol ASConfigurationDelegate 19 | 20 | /** 21 | * Texture performed its first behavior related to the feature(s). 22 | * This can be useful for tracking the impact of the behavior (A/B testing). 23 | */ 24 | - (void)textureDidActivateExperimentalFeatures:(ASExperimentalFeatures)features; 25 | 26 | @optional 27 | 28 | /** 29 | * Texture framework initialized. This method is called synchronously 30 | * on the main thread from ASInitializeFrameworkMainThread if you defined 31 | * AS_INITIALIZE_FRAMEWORK_MANUALLY or from the default initialization point 32 | * (currently +load) otherwise. 33 | */ 34 | - (void)textureDidInitialize; 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/ASControlTargetAction.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASControlTargetAction.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | 13 | /** 14 | @abstract ASControlTargetAction stores target action pairs registered for specific ASControlNodeEvent values. 15 | */ 16 | @interface ASControlTargetAction : NSObject 17 | 18 | /** 19 | The action to be called on the registered target. 20 | */ 21 | @property (nonatomic) SEL action; 22 | 23 | /** 24 | Event handler target. The specified action will be called on this object. 25 | */ 26 | @property (nonatomic, weak) id target; 27 | 28 | /** 29 | Indicated whether this target was created without a target, so the action should travel up in the responder chain. 30 | */ 31 | @property (nonatomic, readonly) BOOL createdWithNoTarget; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/ASDisplayNode+Convenience.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASDisplayNode+Convenience.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @class UIViewController; 16 | 17 | @interface ASDisplayNode (Convenience) 18 | 19 | /** 20 | * @abstract Returns the view controller nearest to this node in the view hierarchy. 21 | * 22 | * @warning This property may only be accessed on the main thread. This property may 23 | * be @c nil until the node's view is actually hosted in the view hierarchy. 24 | */ 25 | @property (nonatomic, nullable, readonly) __kindof UIViewController *closestViewController; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/ASEqualityHelpers.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASEqualityHelpers.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | 12 | /** 13 | @abstract Correctly equates two objects, including cases where both objects are nil. The latter is a case where `isEqual:` fails. 14 | @param obj The first object in the comparison. Can be nil. 15 | @param otherObj The second object in the comparison. Can be nil. 16 | @result YES if the objects are equal, including cases where both object are nil. 17 | */ 18 | ASDISPLAYNODE_INLINE BOOL ASObjectIsEqual(id obj, id otherObj) 19 | { 20 | return obj == otherObj || [obj isEqual:otherObj]; 21 | } 22 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/ASHashing.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASHashing.h 3 | // Texture 4 | // 5 | // Copyright (c) Pinterest, Inc. All rights reserved. 6 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | /** 16 | * When std::hash is unavailable, this function will hash a bucket o' bits real fast. 17 | * The hashing algorithm is copied from CoreFoundation's private function CFHashBytes. 18 | * https://opensource.apple.com/source/CF/CF-1153.18/CFUtilities.c.auto.html 19 | * 20 | * Simple example: 21 | * CGRect myRect = { ... }; 22 | * ASHashBytes(&myRect, sizeof(myRect)); 23 | * 24 | * Example: 25 | * struct { 26 | * NSUInteger imageHash; 27 | * CGSize size; 28 | * } data = { 29 | * _image.hash, 30 | * _bounds.size 31 | * }; 32 | * return ASHashBytes(&data, sizeof(data)); 33 | * 34 | * @warning: If a struct has padding, any fields that are intiailized in {} 35 | * will have garbage data for their padding, which will break this hash! Either 36 | * use `pragma clang diagnostic warning "-Wpadded"` around your struct definition 37 | * or manually initialize the fields of your struct (`myStruct.x = 7;` etc). 38 | */ 39 | AS_EXTERN NSUInteger ASHashBytes(void *bytes, size_t length); 40 | 41 | NS_ASSUME_NONNULL_END 42 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/ASRecursiveUnfairLock.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASRecursiveUnfairLock.h 3 | // Texture 4 | // 5 | // Copyright (c) Pinterest, Inc. All rights reserved. 6 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | // Note: We don't use ATOMIC_VAR_INIT here because C++ compilers don't like it, 16 | // and it literally does absolutely nothing. 17 | #define AS_RECURSIVE_UNFAIR_LOCK_INIT ((ASRecursiveUnfairLock){ OS_UNFAIR_LOCK_INIT, NULL, 0}) 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | OS_UNFAIR_LOCK_AVAILABILITY 22 | typedef struct { 23 | os_unfair_lock _lock OS_UNFAIR_LOCK_AVAILABILITY; 24 | _Atomic(pthread_t) _thread; // Write-protected by lock 25 | int _count; // Protected by lock 26 | } ASRecursiveUnfairLock; 27 | 28 | /** 29 | * Lock, blocking if needed. 30 | */ 31 | AS_EXTERN OS_UNFAIR_LOCK_AVAILABILITY 32 | void ASRecursiveUnfairLockLock(ASRecursiveUnfairLock *l); 33 | 34 | /** 35 | * Try to lock without blocking. Returns whether we took the lock. 36 | */ 37 | AS_EXTERN OS_UNFAIR_LOCK_AVAILABILITY 38 | BOOL ASRecursiveUnfairLockTryLock(ASRecursiveUnfairLock *l); 39 | 40 | /** 41 | * Unlock. Calling this on a thread that does not own 42 | * the lock will result in an assertion failure, and undefined 43 | * behavior if foundation assertions are disabled. 44 | */ 45 | AS_EXTERN OS_UNFAIR_LOCK_AVAILABILITY 46 | void ASRecursiveUnfairLockUnlock(ASRecursiveUnfairLock *l); 47 | 48 | NS_ASSUME_NONNULL_END 49 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/ASScrollDirection.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASScrollDirection.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | #import 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | typedef NS_OPTIONS(NSInteger, ASScrollDirection) { 19 | ASScrollDirectionNone = 0, 20 | ASScrollDirectionRight = 1 << 0, 21 | ASScrollDirectionLeft = 1 << 1, 22 | ASScrollDirectionUp = 1 << 2, 23 | ASScrollDirectionDown = 1 << 3 24 | }; 25 | 26 | AS_EXTERN const ASScrollDirection ASScrollDirectionHorizontalDirections; 27 | AS_EXTERN const ASScrollDirection ASScrollDirectionVerticalDirections; 28 | 29 | AS_EXTERN BOOL ASScrollDirectionContainsVerticalDirection(ASScrollDirection scrollDirection); 30 | AS_EXTERN BOOL ASScrollDirectionContainsHorizontalDirection(ASScrollDirection scrollDirection); 31 | 32 | AS_EXTERN BOOL ASScrollDirectionContainsRight(ASScrollDirection scrollDirection); 33 | AS_EXTERN BOOL ASScrollDirectionContainsLeft(ASScrollDirection scrollDirection); 34 | AS_EXTERN BOOL ASScrollDirectionContainsUp(ASScrollDirection scrollDirection); 35 | AS_EXTERN BOOL ASScrollDirectionContainsDown(ASScrollDirection scrollDirection); 36 | AS_EXTERN ASScrollDirection ASScrollDirectionApplyTransform(ASScrollDirection scrollDirection, CGAffineTransform transform); 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/ASTextNodeTypes.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASTextNodeTypes.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #pragma once 11 | 12 | // Use this attribute name to add "word kerning" 13 | static NSString *const ASTextNodeWordKerningAttributeName = @"ASAttributedStringWordKerning"; 14 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/CoreGraphics+ASConvenience.h: -------------------------------------------------------------------------------- 1 | // 2 | // CoreGraphics+ASConvenience.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | #import 16 | 17 | 18 | #ifndef CGFLOAT_EPSILON 19 | #if CGFLOAT_IS_DOUBLE 20 | #define CGFLOAT_EPSILON DBL_EPSILON 21 | #else 22 | #define CGFLOAT_EPSILON FLT_EPSILON 23 | #endif 24 | #endif 25 | 26 | NS_ASSUME_NONNULL_BEGIN 27 | 28 | ASDISPLAYNODE_INLINE CGFloat ASCGFloatFromString(NSString *string) 29 | { 30 | #if CGFLOAT_IS_DOUBLE 31 | return string.doubleValue; 32 | #else 33 | return string.floatValue; 34 | #endif 35 | } 36 | 37 | ASDISPLAYNODE_INLINE CGFloat ASCGFloatFromNumber(NSNumber *number) 38 | { 39 | #if CGFLOAT_IS_DOUBLE 40 | return number.doubleValue; 41 | #else 42 | return number.floatValue; 43 | #endif 44 | } 45 | 46 | ASDISPLAYNODE_INLINE BOOL CGSizeEqualToSizeWithIn(CGSize size1, CGSize size2, CGFloat delta) 47 | { 48 | return fabs(size1.width - size2.width) < delta && fabs(size1.height - size2.height) < delta; 49 | }; 50 | 51 | NS_ASSUME_NONNULL_END 52 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/UIResponder+AsyncDisplayKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIResponder+AsyncDisplayKit.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface UIResponder (AsyncDisplayKit) 15 | 16 | /** 17 | * The nearest view controller above this responder, if one exists. 18 | * 19 | * This property must be accessed on the main thread. 20 | */ 21 | @property (nonatomic, nullable, readonly) __kindof UIViewController *asdk_associatedViewController; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/PublicHeaders/AsyncDisplayKit/_ASAsyncTransactionGroup.h: -------------------------------------------------------------------------------- 1 | // 2 | // _ASAsyncTransactionGroup.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @protocol ASAsyncTransactionContainer; 17 | 18 | /// A group of transaction containers, for which the current transactions are committed together at the end of the next runloop tick. 19 | AS_SUBCLASSING_RESTRICTED 20 | @interface _ASAsyncTransactionGroup : NSObject 21 | 22 | /// The main transaction group is scheduled to commit on every tick of the main runloop. 23 | /// Access from the main thread only. 24 | @property (class, nonatomic, readonly) _ASAsyncTransactionGroup *mainTransactionGroup; 25 | 26 | - (void)commit; 27 | 28 | /// Add a transaction container to be committed. 29 | - (void)addTransactionContainer:(id)container; 30 | 31 | /// Use the main group. 32 | - (instancetype)init NS_UNAVAILABLE; 33 | + (instancetype)new NS_UNAVAILABLE; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/UIResponder+AsyncDisplayKit.mm: -------------------------------------------------------------------------------- 1 | // 2 | // UIResponder+AsyncDisplayKit.m 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | 12 | #import 13 | #import 14 | #import "ASResponderChainEnumerator.h" 15 | 16 | @implementation UIResponder (AsyncDisplayKit) 17 | 18 | - (__kindof UIViewController *)asdk_associatedViewController 19 | { 20 | ASDisplayNodeAssertMainThread(); 21 | 22 | for (UIResponder *responder in [self asdk_responderChainEnumerator]) { 23 | UIViewController *vc = ASDynamicCast(responder, UIViewController); 24 | if (vc) { 25 | return vc; 26 | } 27 | } 28 | return nil; 29 | } 30 | 31 | @end 32 | 33 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/_ASAsyncTransactionContainer+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // _ASAsyncTransactionContainer+Private.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @class _ASAsyncTransaction; 16 | 17 | @interface CALayer (ASAsyncTransactionContainerTransactions) 18 | @property (nonatomic, nullable, setter=asyncdisplaykit_setAsyncLayerTransactions:) NSHashTable<_ASAsyncTransaction *> *asyncdisplaykit_asyncLayerTransactions; 19 | 20 | - (void)asyncdisplaykit_asyncTransactionContainerWillBeginTransaction:(_ASAsyncTransaction *)transaction; 21 | - (void)asyncdisplaykit_asyncTransactionContainerDidCompleteTransaction:(_ASAsyncTransaction *)transaction; 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/_ASDisplayViewAccessiblity.h: -------------------------------------------------------------------------------- 1 | // 2 | // _ASDisplayViewAccessiblity.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | #import 12 | 13 | // WARNING: When dealing with accessibility elements, please use the `accessibilityElements` 14 | // property instead of the older methods e.g. `accessibilityElementCount()`. While the older methods 15 | // should still work as long as accessibility is enabled, this framework provides no guarantees on 16 | // their correctness. For details, see 17 | // https://developer.apple.com/documentation/objectivec/nsobject/1615147-accessibilityelements 18 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/_ASPendingState.h: -------------------------------------------------------------------------------- 1 | // 2 | // _ASPendingState.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #import 11 | 12 | #import 13 | 14 | /** 15 | 16 | Private header for ASDisplayNode.mm 17 | 18 | _ASPendingState is a proxy for a UIView that has yet to be created. 19 | In response to its setters, it sets an internal property and a flag that indicates that that property has been set. 20 | 21 | When you want to configure a view from this pending state information, just call -applyToView: 22 | */ 23 | 24 | @interface _ASPendingState : NSObject 25 | 26 | // Supports all of the properties included in the ASDisplayNodeViewProperties protocol 27 | 28 | - (void)applyToView:(UIView *)view withSpecialPropertiesHandling:(BOOL)setFrameDirectly; 29 | - (void)applyToLayer:(CALayer *)layer; 30 | 31 | + (_ASPendingState *)pendingViewStateFromLayer:(CALayer *)layer; 32 | + (_ASPendingState *)pendingViewStateFromView:(UIView *)view; 33 | 34 | @property (nonatomic, readonly) BOOL hasSetNeedsLayout; 35 | @property (nonatomic, readonly) BOOL hasSetNeedsDisplay; 36 | 37 | @property (nonatomic, readonly) BOOL hasChanges; 38 | 39 | - (void)clearChanges; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /submodules/AsyncDisplayKit/Source/_ASScopeTimer.h: -------------------------------------------------------------------------------- 1 | // 2 | // _ASScopeTimer.h 3 | // Texture 4 | // 5 | // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 6 | // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. 7 | // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | 10 | #pragma once 11 | 12 | /** 13 | Must compile as c++ for this to work. 14 | 15 | Usage: 16 | // Can be an ivar or local variable 17 | NSTimeInterval placeToStoreTiming; 18 | 19 | { 20 | // some scope 21 | AS::ScopeTimer t(placeToStoreTiming); 22 | DoPotentiallySlowWork(); 23 | MorePotentiallySlowWork(); 24 | } 25 | 26 | */ 27 | 28 | namespace AS { 29 | struct ScopeTimer { 30 | NSTimeInterval begin; 31 | NSTimeInterval &outT; 32 | ScopeTimer(NSTimeInterval &outRef) : outT(outRef) { 33 | begin = CACurrentMediaTime(); 34 | } 35 | ~ScopeTimer() { 36 | outT = CACurrentMediaTime() - begin; 37 | } 38 | }; 39 | 40 | // variant where repeated calls are summed 41 | struct SumScopeTimer { 42 | NSTimeInterval begin; 43 | NSTimeInterval &outT; 44 | BOOL enable; 45 | SumScopeTimer(NSTimeInterval &outRef, BOOL enable = YES) : outT(outRef), enable(enable) { 46 | if (enable) { 47 | begin = CACurrentMediaTime(); 48 | } 49 | } 50 | ~SumScopeTimer() { 51 | if (enable) { 52 | outT += CACurrentMediaTime() - begin; 53 | } 54 | } 55 | }; 56 | } 57 | -------------------------------------------------------------------------------- /submodules/BuildConfig/BUILD: -------------------------------------------------------------------------------- 1 | load( 2 | "//build-input/data:variables.bzl", 3 | "telegram_api_id", 4 | "telegram_api_hash", 5 | "telegram_app_center_id", 6 | "telegram_is_internal_build", 7 | "telegram_is_appstore_build", 8 | "telegram_appstore_id", 9 | "telegram_app_specific_url_scheme", 10 | ) 11 | 12 | objc_library( 13 | name = "BuildConfig", 14 | module_name = "BuildConfig", 15 | enable_modules = True, 16 | srcs = glob([ 17 | "Sources/*.m", 18 | ]), 19 | copts = [ 20 | "-DAPP_CONFIG_API_ID={}".format(telegram_api_id), 21 | "-DAPP_CONFIG_API_HASH=\\\"{}\\\"".format(telegram_api_hash), 22 | "-DAPP_CONFIG_APP_CENTER_ID=\\\"{}\\\"".format(telegram_app_center_id), 23 | "-DAPP_CONFIG_IS_INTERNAL_BUILD={}".format(telegram_is_internal_build), 24 | "-DAPP_CONFIG_IS_APPSTORE_BUILD={}".format(telegram_is_appstore_build), 25 | "-DAPP_CONFIG_APPSTORE_ID={}".format(telegram_appstore_id), 26 | "-DAPP_SPECIFIC_URL_SCHEME=\\\"{}\\\"".format(telegram_app_specific_url_scheme), 27 | ], 28 | hdrs = glob([ 29 | "Sources/*.h", 30 | ]), 31 | deps = [ 32 | ], 33 | visibility = ["//visibility:public"], 34 | ) 35 | -------------------------------------------------------------------------------- /submodules/BuildConfig/Sources/BuildConfig.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface DeviceSpecificEncryptionParameters : NSObject 4 | 5 | @property (nonatomic, strong) NSData * _Nonnull key; 6 | @property (nonatomic, strong) NSData * _Nonnull salt; 7 | 8 | @end 9 | 10 | @interface BuildConfig : NSObject 11 | 12 | - (instancetype _Nonnull)initWithBaseAppBundleId:(NSString * _Nonnull)baseAppBundleId; 13 | 14 | @property (nonatomic, strong, readonly) NSString * _Nullable appCenterId; 15 | @property (nonatomic, readonly) int32_t apiId; 16 | @property (nonatomic, strong, readonly) NSString * _Nonnull apiHash; 17 | @property (nonatomic, readonly) bool isInternalBuild; 18 | @property (nonatomic, readonly) bool isAppStoreBuild; 19 | @property (nonatomic, readonly) int64_t appStoreId; 20 | @property (nonatomic, strong, readonly) NSString * _Nonnull appSpecificUrlScheme; 21 | 22 | + (DeviceSpecificEncryptionParameters * _Nonnull)deviceSpecificEncryptionParameters:(NSString * _Nonnull)rootPath baseAppBundleId:(NSString * _Nonnull)baseAppBundleId; 23 | - (NSData * _Nullable)bundleDataWithAppToken:(NSData * _Nullable)appToken signatureDict:(NSDictionary * _Nullable)signatureDict; 24 | 25 | + (void)getHardwareEncryptionAvailableWithBaseAppBundleId:(NSString * _Nonnull)baseAppBundleId completion:(void (^)(NSData * _Nullable))completion; 26 | + (void)encryptApplicationSecret:(NSData * _Nonnull)secret baseAppBundleId:(NSString * _Nonnull)baseAppBundleId completion:(void (^)(NSData * _Nullable, NSData * _Nullable))completion; 27 | + (void)decryptApplicationSecret:(NSData * _Nonnull)secret publicKey:(NSData * _Nonnull)publicKey baseAppBundleId:(NSString * _Nonnull)baseAppBundleId completion:(void (^)(NSData * _Nullable, bool))completion; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /submodules/Camera/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "Camera", 5 | module_name = "Camera", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | deps = [ 10 | "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit", 11 | "//submodules/AsyncDisplayKit:AsyncDisplayKit", 12 | "//submodules/Display:Display", 13 | ], 14 | visibility = [ 15 | "//visibility:public", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /submodules/Camera/Sources/CameraPreviewNode.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import AsyncDisplayKit 3 | import Display 4 | import AVFoundation 5 | 6 | private final class CameraPreviewNodeLayerNullAction: NSObject, CAAction { 7 | @objc func run(forKey event: String, object anObject: Any, arguments dict: [AnyHashable : Any]?) { 8 | } 9 | } 10 | 11 | private final class CameraPreviewNodeLayer: AVSampleBufferDisplayLayer { 12 | override func action(forKey event: String) -> CAAction? { 13 | return CameraPreviewNodeLayerNullAction() 14 | } 15 | } 16 | 17 | public final class CameraPreviewNode: ASDisplayNode { 18 | private var displayLayer: AVSampleBufferDisplayLayer 19 | 20 | public override init() { 21 | self.displayLayer = AVSampleBufferDisplayLayer() 22 | self.displayLayer.videoGravity = .resizeAspectFill 23 | 24 | super.init() 25 | 26 | self.clipsToBounds = true 27 | 28 | self.layer.addSublayer(self.displayLayer) 29 | } 30 | 31 | func prepare() { 32 | DispatchQueue.main.async { 33 | self.displayLayer.flushAndRemoveImage() 34 | } 35 | } 36 | 37 | func enqueue(_ sampleBuffer: CMSampleBuffer) { 38 | self.displayLayer.enqueue(sampleBuffer) 39 | } 40 | 41 | override public func layout() { 42 | super.layout() 43 | 44 | var transform = CGAffineTransform(rotationAngle: CGFloat.pi / 2.0) 45 | transform = transform.scaledBy(x: 1.0, y: 1.0) 46 | self.displayLayer.setAffineTransform(transform) 47 | 48 | self.displayLayer.frame = self.bounds 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /submodules/Camera/Sources/CameraUtils.swift: -------------------------------------------------------------------------------- 1 | import AVFoundation 2 | 3 | extension AVFrameRateRange { 4 | func clamp(rate: Float64) -> Float64 { 5 | return max(self.minFrameRate, min(self.maxFrameRate, rate)) 6 | } 7 | 8 | func contains(rate: Float64) -> Bool { 9 | return (self.minFrameRate...self.maxFrameRate) ~= rate 10 | } 11 | } 12 | 13 | extension AVCaptureDevice { 14 | func actualFPS(_ fps: Double) -> (fps: Double, duration: CMTime)? { 15 | var durations: [CMTime] = [] 16 | var frameRates: [Double] = [] 17 | 18 | for range in self.activeFormat.videoSupportedFrameRateRanges { 19 | if range.minFrameRate == range.maxFrameRate { 20 | durations.append(range.minFrameDuration) 21 | frameRates.append(range.maxFrameRate) 22 | continue 23 | } 24 | 25 | if range.contains(rate: fps) { 26 | return (fps, CMTimeMake(value: 100, timescale: Int32(100 * fps))) 27 | } 28 | 29 | let actualFPS: Double = range.clamp(rate: fps) 30 | return (actualFPS, CMTimeMake(value: 100, timescale: Int32(100 * actualFPS))) 31 | } 32 | 33 | let diff = frameRates.map { abs($0 - fps) } 34 | 35 | if let minElement: Float64 = diff.min() { 36 | for i in 0.. Bool)? 7 | public var focused: (() -> Void)? 8 | 9 | override public init() { 10 | super.init() 11 | 12 | self.isAccessibilityElement = true 13 | } 14 | 15 | override public func accessibilityActivate() -> Bool { 16 | return self.activate?() ?? false 17 | } 18 | 19 | override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { 20 | return nil 21 | } 22 | 23 | override public func accessibilityElementDidBecomeFocused() { 24 | if let focused = self.focused { 25 | focused() 26 | } else { 27 | var supernode = self.supernode 28 | while true { 29 | if let supernodeValue = supernode { 30 | if let listItemNode = supernodeValue as? ListViewItemNode { 31 | listItemNode.accessibilityElementDidBecomeFocused() 32 | break 33 | } else { 34 | supernode = supernodeValue.supernode 35 | } 36 | } else { 37 | break 38 | } 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /submodules/Display/Source/ActionSheetItem.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public protocol ActionSheetItem { 4 | func node(theme: ActionSheetControllerTheme) -> ActionSheetItemNode 5 | func updateNode(_ node: ActionSheetItemNode) -> Void 6 | } 7 | -------------------------------------------------------------------------------- /submodules/Display/Source/ActionSheetItemGroup.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | public final class ActionSheetItemGroup { 4 | let items: [ActionSheetItem] 5 | let leadingVisibleNodeCount: CGFloat? 6 | 7 | public init(items: [ActionSheetItem], leadingVisibleNodeCount: CGFloat? = nil) { 8 | self.items = items 9 | self.leadingVisibleNodeCount = leadingVisibleNodeCount 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /submodules/Display/Source/ActionSheetItemNode.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import AsyncDisplayKit 3 | 4 | open class ActionSheetItemNode: ASDisplayNode { 5 | private let theme: ActionSheetControllerTheme 6 | 7 | public let backgroundNode: ASDisplayNode 8 | private let overflowSeparatorNode: ASDisplayNode 9 | 10 | public init(theme: ActionSheetControllerTheme) { 11 | self.theme = theme 12 | 13 | self.backgroundNode = ASDisplayNode() 14 | self.backgroundNode.backgroundColor = self.theme.itemBackgroundColor 15 | 16 | self.overflowSeparatorNode = ASDisplayNode() 17 | self.overflowSeparatorNode.backgroundColor = self.theme.itemHighlightedBackgroundColor 18 | 19 | super.init() 20 | 21 | self.addSubnode(self.backgroundNode) 22 | self.addSubnode(self.overflowSeparatorNode) 23 | } 24 | 25 | open override func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize { 26 | return CGSize(width: constrainedSize.width, height: 57.0) 27 | } 28 | 29 | open override func layout() { 30 | self.backgroundNode.frame = CGRect(origin: CGPoint(), size: self.calculatedSize) 31 | self.overflowSeparatorNode.frame = CGRect(origin: CGPoint(x: 0.0, y: self.calculatedSize.height), size: CGSize(width: self.calculatedSize.width, height: UIScreenPixel)) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /submodules/Display/Source/AlertContentNode.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | 5 | open class AlertContentNode: ASDisplayNode { 6 | open var requestLayout: ((ContainedViewLayoutTransition) -> Void)? 7 | 8 | open var dismissOnOutsideTap: Bool { 9 | return true 10 | } 11 | 12 | open func updateLayout(size: CGSize, transition: ContainedViewLayoutTransition) -> CGSize { 13 | assertionFailure() 14 | 15 | return CGSize() 16 | } 17 | 18 | open func updateTheme(_ theme: AlertControllerTheme) { 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /submodules/Display/Source/ContainableController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import AsyncDisplayKit 3 | import SwiftSignalKit 4 | 5 | public protocol PresentableController: class { 6 | func viewDidAppear(completion: @escaping () -> Void) 7 | } 8 | 9 | public protocol ContainableController: class { 10 | var view: UIView! { get } 11 | var displayNode: ASDisplayNode { get } 12 | var isViewLoaded: Bool { get } 13 | var isOpaqueWhenInOverlay: Bool { get } 14 | var blocksBackgroundWhenInOverlay: Bool { get } 15 | var ready: Promise { get } 16 | var updateTransitionWhenPresentedAsModal: ((CGFloat, ContainedViewLayoutTransition) -> Void)? { get set } 17 | 18 | func combinedSupportedOrientations(currentOrientationToLock: UIInterfaceOrientationMask) -> ViewControllerSupportedOrientations 19 | var deferScreenEdgeGestures: UIRectEdge { get } 20 | var prefersOnScreenNavigationHidden: Bool { get } 21 | 22 | func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) 23 | func updateToInterfaceOrientation(_ orientation: UIInterfaceOrientation) 24 | func updateModalTransition(_ value: CGFloat, transition: ContainedViewLayoutTransition) 25 | func preferredContentSizeForLayout(_ layout: ContainerViewLayout) -> CGSize? 26 | 27 | func viewWillAppear(_ animated: Bool) 28 | func viewWillDisappear(_ animated: Bool) 29 | func viewDidAppear(_ animated: Bool) 30 | func viewDidDisappear(_ animated: Bool) 31 | } 32 | -------------------------------------------------------------------------------- /submodules/Display/Source/ContextContentContainerNode.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import AsyncDisplayKit 3 | 4 | public final class ContextContentContainerNode: ASDisplayNode { 5 | public var contentNode: ContextContentNode? 6 | 7 | override public init() { 8 | super.init() 9 | } 10 | 11 | public func updateLayout(size: CGSize, scaledSize: CGSize, transition: ContainedViewLayoutTransition) { 12 | guard let contentNode = self.contentNode else { 13 | return 14 | } 15 | switch contentNode { 16 | case .extracted: 17 | break 18 | case let .controller(controller): 19 | transition.updatePosition(node: controller, position: CGPoint(x: scaledSize.width / 2.0, y: scaledSize.height / 2.0)) 20 | transition.updateBounds(node: controller, bounds: CGRect(origin: CGPoint(), size: size)) 21 | transition.updateTransformScale(node: controller, scale: scaledSize.width / size.width) 22 | controller.updateLayout(size: size, transition: transition) 23 | controller.controller.containerLayoutUpdated(ContainerViewLayout(size: size, metrics: LayoutMetrics(widthClass: .compact, heightClass: .compact), deviceMetrics: .iPhoneX, intrinsicInsets: UIEdgeInsets(), safeInsets: UIEdgeInsets(), statusBarHeight: nil, inputHeight: nil, inputHeightIsInteractivellyChanging: false, inVoiceOver: false), transition: transition) 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /submodules/Display/Source/ContextMenuAction.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | public enum ContextMenuActionContent { 4 | case text(title: String, accessibilityLabel: String) 5 | case icon(UIImage) 6 | } 7 | 8 | public struct ContextMenuAction { 9 | public let content: ContextMenuActionContent 10 | public let action: () -> Void 11 | 12 | public init(content: ContextMenuActionContent, action: @escaping () -> Void) { 13 | self.content = content 14 | self.action = action 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /submodules/Display/Source/DisplayLinkDispatcher.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | public class DisplayLinkDispatcher: NSObject { 5 | private var displayLink: CADisplayLink! 6 | private var blocksToDispatch: [() -> Void] = [] 7 | private let limit: Int 8 | 9 | public init(limit: Int = 0) { 10 | self.limit = limit 11 | 12 | super.init() 13 | 14 | if #available(iOS 10.0, *) { 15 | //self.displayLink.preferredFramesPerSecond = 60 16 | } else { 17 | self.displayLink = CADisplayLink(target: self, selector: #selector(self.run)) 18 | self.displayLink.isPaused = true 19 | self.displayLink.add(to: RunLoop.main, forMode: .common) 20 | } 21 | } 22 | 23 | public func dispatch(f: @escaping () -> Void) { 24 | if self.displayLink == nil { 25 | if Thread.isMainThread { 26 | f() 27 | } else { 28 | DispatchQueue.main.async(execute: f) 29 | } 30 | } else { 31 | self.blocksToDispatch.append(f) 32 | self.displayLink.isPaused = false 33 | } 34 | } 35 | 36 | @objc func run() { 37 | for _ in 0 ..< (self.limit == 0 ? 1000 : self.limit) { 38 | if self.blocksToDispatch.count == 0 { 39 | self.displayLink.isPaused = true 40 | break 41 | } else { 42 | let f = self.blocksToDispatch.removeFirst() 43 | f() 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /submodules/Display/Source/GridItem.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | 5 | public protocol GridSection { 6 | var height: CGFloat { get } 7 | var hashValue: Int { get } 8 | 9 | func isEqual(to: GridSection) -> Bool 10 | func node() -> ASDisplayNode 11 | } 12 | 13 | public protocol GridItem { 14 | var section: GridSection? { get } 15 | func node(layout: GridNodeLayout, synchronousLoad: Bool) -> GridItemNode 16 | func update(node: GridItemNode) 17 | var aspectRatio: CGFloat { get } 18 | var fillsRowWithHeight: CGFloat? { get } 19 | var fillsRowWithDynamicHeight: ((CGFloat) -> CGFloat)? { get } 20 | } 21 | 22 | public extension GridItem { 23 | var aspectRatio: CGFloat { 24 | return 1.0 25 | } 26 | 27 | var fillsRowWithHeight: CGFloat? { 28 | return nil 29 | } 30 | 31 | var fillsRowWithDynamicHeight: ((CGFloat) -> CGFloat)? { 32 | return nil 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /submodules/Display/Source/GridItemNode.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | 5 | open class GridItemNode: ASDisplayNode { 6 | open var isVisibleInGrid = false 7 | open var isGridScrolling = false 8 | 9 | final var cachedFrame: CGRect = CGRect() 10 | override open var frame: CGRect { 11 | get { 12 | return self.cachedFrame 13 | } set(value) { 14 | self.cachedFrame = value 15 | super.frame = value 16 | } 17 | } 18 | 19 | open func updateLayout(item: GridItem, size: CGSize, isVisible: Bool, synchronousLoads: Bool) { 20 | } 21 | 22 | open func updateAbsoluteRect(_ absoluteRect: CGRect, within containerSize: CGSize) { 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /submodules/Display/Source/GridNodeScroller.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import AsyncDisplayKit 3 | 4 | private class GridNodeScrollerLayer: CALayer { 5 | override func setNeedsDisplay() { 6 | } 7 | } 8 | 9 | private class GridNodeScrollerView: UIScrollView { 10 | override class var layerClass: AnyClass { 11 | return GridNodeScrollerLayer.self 12 | } 13 | 14 | override init(frame: CGRect) { 15 | super.init(frame: frame) 16 | 17 | if #available(iOSApplicationExtension 11.0, iOS 11.0, *) { 18 | self.contentInsetAdjustmentBehavior = .never 19 | } 20 | } 21 | 22 | required init?(coder aDecoder: NSCoder) { 23 | fatalError("init(coder:) has not been implemented") 24 | } 25 | 26 | override func touchesShouldCancel(in view: UIView) -> Bool { 27 | return true 28 | } 29 | 30 | @objc func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { 31 | return false 32 | } 33 | } 34 | 35 | open class GridNodeScroller: ASDisplayNode, UIGestureRecognizerDelegate { 36 | public var scrollView: UIScrollView { 37 | return self.view as! UIScrollView 38 | } 39 | 40 | override init() { 41 | super.init() 42 | 43 | self.setViewBlock({ 44 | return GridNodeScrollerView(frame: CGRect()) 45 | }) 46 | 47 | self.scrollView.scrollsToTop = false 48 | } 49 | 50 | required public init?(coder aDecoder: NSCoder) { 51 | fatalError("init(coder:) has not been implemented") 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /submodules/Display/Source/KeyShortcut.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | public struct KeyShortcut: Hashable { 4 | let title: String 5 | let input: String 6 | let modifiers: UIKeyModifierFlags 7 | let action: () -> Void 8 | 9 | public init(title: String = "", input: String = "", modifiers: UIKeyModifierFlags = [], action: @escaping () -> Void = {}) { 10 | self.title = title 11 | self.input = input 12 | self.modifiers = modifiers 13 | self.action = action 14 | } 15 | 16 | public func hash(into hasher: inout Hasher) { 17 | hasher.combine(self.input) 18 | hasher.combine(self.modifiers) 19 | } 20 | 21 | public static func ==(lhs: KeyShortcut, rhs: KeyShortcut) -> Bool { 22 | return lhs.hashValue == rhs.hashValue 23 | } 24 | } 25 | 26 | extension UIKeyModifierFlags: Hashable { 27 | public var hashValue: Int { 28 | return self.rawValue 29 | } 30 | } 31 | 32 | extension KeyShortcut { 33 | var uiKeyCommand: UIKeyCommand { 34 | if #available(iOSApplicationExtension 9.0, iOS 9.0, *), !self.title.isEmpty { 35 | return UIKeyCommand(input: self.input, modifierFlags: self.modifiers, action: #selector(KeyShortcutsController.handleKeyCommand(_:)), discoverabilityTitle: self.title) 36 | } else { 37 | return UIKeyCommand(input: self.input, modifierFlags: self.modifiers, action: #selector(KeyShortcutsController.handleKeyCommand(_:))) 38 | } 39 | } 40 | 41 | func isEqual(to command: UIKeyCommand) -> Bool { 42 | return self.input == command.input && self.modifiers == command.modifierFlags 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /submodules/Display/Source/Keyboard.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKitRuntimeUtils 3 | 4 | public enum Keyboard { 5 | public static func applyAutocorrection() { 6 | applyKeyboardAutocorrection() 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /submodules/Display/Source/LayoutSizes.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | public func horizontalContainerFillingSizeForLayout(layout: ContainerViewLayout, sideInset: CGFloat) -> CGFloat { 5 | if case .regular = layout.metrics.widthClass { 6 | return min(layout.size.width, 414.0) - sideInset * 2.0 7 | } else { 8 | return min(layout.size.width, 414.0) - sideInset * 2.0 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /submodules/Display/Source/ListViewAccessoryItem.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public protocol ListViewAccessoryItem { 4 | func isEqualToItem(_ other: ListViewAccessoryItem) -> Bool 5 | func node(synchronous: Bool) -> ListViewAccessoryItemNode 6 | } 7 | -------------------------------------------------------------------------------- /submodules/Display/Source/ListViewFloatingHeaderNode.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | 5 | open class ListViewFloatingHeaderNode: ASDisplayNode { 6 | open func updateLayout(width: CGFloat, leftInset: CGFloat, rightInset: CGFloat, transition: ContainedViewLayoutTransition) -> CGFloat { 7 | return 0.0 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /submodules/Display/Source/ListViewOverscrollBackgroundNode.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | 5 | final class ListViewOverscrollBackgroundNode: ASDisplayNode { 6 | private let backgroundNode: ASDisplayNode 7 | 8 | var color: UIColor { 9 | didSet { 10 | self.backgroundNode.backgroundColor = color 11 | } 12 | } 13 | 14 | init(color: UIColor) { 15 | self.color = color 16 | 17 | self.backgroundNode = ASDisplayNode() 18 | self.backgroundNode.backgroundColor = color 19 | self.backgroundNode.isLayerBacked = true 20 | 21 | super.init() 22 | 23 | self.addSubnode(self.backgroundNode) 24 | } 25 | 26 | func updateLayout(size: CGSize, transition: ContainedViewLayoutTransition) { 27 | transition.updateFrame(node: self.backgroundNode, frame: CGRect(origin: CGPoint(), size: size)) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /submodules/Display/Source/ListViewTapGestureRecognizer.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | public final class ListViewTapGestureRecognizer: UITapGestureRecognizer { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /submodules/Display/Source/ListViewTempItemNode.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | final class ListViewTempItemNode: ListViewItemNode { 4 | } 5 | -------------------------------------------------------------------------------- /submodules/Display/Source/MinimizeKeyboardGestureRecognizer.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | final class MinimizeKeyboardGestureRecognizer: UISwipeGestureRecognizer, UIGestureRecognizerDelegate { 5 | override init(target: Any?, action: Selector?) { 6 | super.init(target: target, action: action) 7 | 8 | self.cancelsTouchesInView = false 9 | self.delaysTouchesBegan = false 10 | self.delaysTouchesEnded = false 11 | self.delegate = self 12 | 13 | self.direction = [.left, .right] 14 | self.numberOfTouchesRequired = 2 15 | } 16 | 17 | func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { 18 | return true 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /submodules/Display/Source/NavigationBarContentNode.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | 5 | public enum NavigationBarContentMode { 6 | case replacement 7 | case expansion 8 | } 9 | 10 | open class NavigationBarContentNode: ASDisplayNode { 11 | open var requestContainerLayout: (ContainedViewLayoutTransition) -> Void = { _ in } 12 | 13 | open var height: CGFloat { 14 | return self.nominalHeight 15 | } 16 | 17 | open var clippedHeight: CGFloat { 18 | return self.nominalHeight 19 | } 20 | 21 | open var nominalHeight: CGFloat { 22 | return 44.0 23 | } 24 | 25 | open var mode: NavigationBarContentMode { 26 | return .replacement 27 | } 28 | 29 | open func updateLayout(size: CGSize, leftInset: CGFloat, rightInset: CGFloat, transition: ContainedViewLayoutTransition) { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /submodules/Display/Source/NavigationBarTitleTransitionNode.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import AsyncDisplayKit 3 | 4 | public protocol NavigationBarTitleTransitionNode { 5 | func makeTransitionMirrorNode() -> ASDisplayNode 6 | } 7 | -------------------------------------------------------------------------------- /submodules/Display/Source/NavigationBarTitleView.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | public protocol NavigationBarTitleView { 5 | func animateLayoutTransition() 6 | 7 | func updateLayout(size: CGSize, clearBounds: CGRect, transition: ContainedViewLayoutTransition) 8 | } 9 | -------------------------------------------------------------------------------- /submodules/Display/Source/NavigationBarTransitionState.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | enum NavigationBarTransitionRole { 5 | case top 6 | case bottom 7 | } 8 | 9 | final class NavigationBarTransitionState { 10 | weak var navigationBar: NavigationBar? 11 | let transition: NavigationTransition 12 | let role: NavigationBarTransitionRole 13 | let progress: CGFloat 14 | 15 | init(navigationBar: NavigationBar, transition: NavigationTransition, role: NavigationBarTransitionRole, progress: CGFloat) { 16 | self.navigationBar = navigationBar 17 | self.transition = transition 18 | self.role = role 19 | self.progress = progress 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /submodules/Display/Source/Nodes/ASImageNode.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | 5 | open class ASImageNode: ASDisplayNode { 6 | public var image: UIImage? { 7 | didSet { 8 | if let image = self.image { 9 | let capInsets = image.capInsets 10 | if capInsets.left.isZero && capInsets.top.isZero { 11 | self.contentsScale = image.scale 12 | self.contents = image.cgImage 13 | } else { 14 | ASDisplayNodeSetResizableContents(self, image) 15 | } 16 | } else { 17 | self.contents = nil 18 | } 19 | if self.image?.size != oldValue?.size { 20 | self.invalidateCalculatedLayout() 21 | } 22 | } 23 | } 24 | 25 | public var displayWithoutProcessing: Bool = true 26 | 27 | override public init() { 28 | super.init() 29 | } 30 | 31 | override public func calculateSizeThatFits(_ contrainedSize: CGSize) -> CGSize { 32 | return self.image?.size ?? CGSize() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /submodules/Display/Source/PeekControllerContent.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | 5 | public enum PeekControllerContentPresentation { 6 | case contained 7 | case freeform 8 | } 9 | 10 | public enum PeerkControllerMenuActivation { 11 | case drag 12 | case press 13 | } 14 | 15 | public protocol PeekControllerContent { 16 | func presentation() -> PeekControllerContentPresentation 17 | func menuActivation() -> PeerkControllerMenuActivation 18 | func menuItems() -> [PeekControllerMenuItem] 19 | func node() -> PeekControllerContentNode & ASDisplayNode 20 | 21 | func topAccessoryNode() -> ASDisplayNode? 22 | 23 | func isEqual(to: PeekControllerContent) -> Bool 24 | } 25 | 26 | public protocol PeekControllerContentNode { 27 | func updateLayout(size: CGSize, transition: ContainedViewLayoutTransition) -> CGSize 28 | } 29 | -------------------------------------------------------------------------------- /submodules/Display/Source/PeekControllerMenuNode.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | 5 | final class PeekControllerMenuNode: ASDisplayNode { 6 | private let itemNodes: [PeekControllerMenuItemNode] 7 | 8 | init(theme: PeekControllerTheme, items: [PeekControllerMenuItem], activatedAction: @escaping () -> Void) { 9 | self.itemNodes = items.map { PeekControllerMenuItemNode(theme: theme, item: $0, activatedAction: activatedAction) } 10 | 11 | super.init() 12 | 13 | self.backgroundColor = theme.menuBackgroundColor 14 | self.cornerRadius = 16.0 15 | self.clipsToBounds = true 16 | 17 | for itemNode in self.itemNodes { 18 | self.addSubnode(itemNode) 19 | } 20 | } 21 | 22 | func updateLayout(width: CGFloat, transition: ContainedViewLayoutTransition) -> CGFloat { 23 | var verticalOffset: CGFloat = 0.0 24 | for itemNode in self.itemNodes { 25 | let itemHeight = itemNode.updateLayout(width: width, transition: transition) 26 | transition.updateFrame(node: itemNode, frame: CGRect(origin: CGPoint(x: 0.0, y: verticalOffset), size: CGSize(width: width, height: itemHeight))) 27 | verticalOffset += itemHeight 28 | } 29 | return verticalOffset - UIScreenPixel 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /submodules/Display/Source/RuntimeUtils.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | private let systemVersion = { () -> (Int, Int) in 5 | let string = UIDevice.current.systemVersion as NSString 6 | var minor = 0 7 | let range = string.range(of: ".") 8 | if range.location != NSNotFound { 9 | minor = Int((string.substring(from: range.location + 1) as NSString).intValue) 10 | } 11 | return (Int(string.intValue), minor) 12 | }() 13 | 14 | public func matchMinimumSystemVersion(major: Int, minor: Int = 0) -> Bool { 15 | let version = systemVersion 16 | if version.0 == major { 17 | return version.1 >= minor 18 | } else if version.0 < major { 19 | return false 20 | } else { 21 | return true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /submodules/Display/Source/ScrollToTopProxyView.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import AsyncDisplayKit 3 | 4 | class ScrollToTopView: UIScrollView, UIScrollViewDelegate { 5 | var action: (() -> Void)? 6 | 7 | override init(frame: CGRect) { 8 | super.init(frame: frame) 9 | 10 | self.isOpaque = false 11 | self.backgroundColor = .clear 12 | self.delegate = self 13 | self.scrollsToTop = true 14 | if #available(iOSApplicationExtension 11.0, iOS 11.0, *) { 15 | self.contentInsetAdjustmentBehavior = .never 16 | } 17 | } 18 | 19 | required init?(coder aDecoder: NSCoder) { 20 | fatalError("init(coder:) has not been implemented") 21 | } 22 | 23 | override var frame: CGRect { 24 | didSet { 25 | let frame = self.frame 26 | self.contentSize = CGSize(width: frame.width, height: frame.height + 1.0) 27 | self.contentOffset = CGPoint(x: 0.0, y: 1.0) 28 | } 29 | } 30 | 31 | @objc func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool { 32 | if let action = self.action { 33 | action() 34 | } 35 | 36 | return false 37 | } 38 | } 39 | 40 | class ScrollToTopNode: ASDisplayNode { 41 | init(action: @escaping () -> Void) { 42 | super.init() 43 | 44 | self.setViewBlock({ 45 | let view = ScrollToTopView(frame: CGRect()) 46 | view.action = action 47 | return view 48 | }) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /submodules/Display/Source/ShakeAnimation.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | public extension CALayer { 5 | func addShakeAnimation(amplitude: CGFloat = 3.0, duration: Double = 0.3, count: Int = 4, decay: Bool = false) { 6 | let k = Float(UIView.animationDurationFactor()) 7 | var speed: Float = 1.0 8 | if k != 0 && k != 1 { 9 | speed = Float(1.0) / k 10 | } 11 | 12 | let animation = CAKeyframeAnimation(keyPath: "position.x") 13 | var values: [CGFloat] = [] 14 | values.append(0.0) 15 | for i in 0 ..< count { 16 | let sign: CGFloat = (i % 2 == 0) ? 1.0 : -1.0 17 | let multiplier = decay ? 1.0 / CGFloat(i + 1) : 1.0 18 | values.append(amplitude * sign * multiplier) 19 | } 20 | values.append(0.0) 21 | animation.values = values.map { ($0 as NSNumber) as AnyObject } 22 | var keyTimes: [NSNumber] = [] 23 | for i in 0 ..< values.count { 24 | if i == 0 { 25 | keyTimes.append(0.0) 26 | } else if i == values.count - 1 { 27 | keyTimes.append(1.0) 28 | } else { 29 | keyTimes.append((Double(i) / Double(values.count - 1)) as NSNumber) 30 | } 31 | } 32 | animation.keyTimes = keyTimes 33 | animation.speed = speed 34 | animation.duration = duration 35 | animation.isAdditive = true 36 | 37 | self.add(animation, forKey: "shake") 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /submodules/Display/Source/StatusBarHost.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import SwiftSignalKit 3 | 4 | public protocol StatusBarHost { 5 | var statusBarFrame: CGRect { get } 6 | var statusBarStyle: UIStatusBarStyle { get set } 7 | 8 | var keyboardWindow: UIWindow? { get } 9 | var keyboardView: UIView? { get } 10 | 11 | var isApplicationInForeground: Bool { get } 12 | 13 | func setStatusBarStyle(_ style: UIStatusBarStyle, animated: Bool) 14 | func setStatusBarHidden(_ value: Bool, animated: Bool) 15 | } 16 | -------------------------------------------------------------------------------- /submodules/Display/Source/Toolbar.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | public struct ToolbarAction: Equatable { 5 | public let title: String 6 | public let isEnabled: Bool 7 | 8 | public init(title: String, isEnabled: Bool) { 9 | self.title = title 10 | self.isEnabled = isEnabled 11 | } 12 | } 13 | 14 | public struct Toolbar: Equatable { 15 | public let leftAction: ToolbarAction? 16 | public let rightAction: ToolbarAction? 17 | public let middleAction: ToolbarAction? 18 | 19 | public init(leftAction: ToolbarAction?, rightAction: ToolbarAction?, middleAction: ToolbarAction?) { 20 | self.leftAction = leftAction 21 | self.rightAction = rightAction 22 | self.middleAction = middleAction 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /submodules/Display/Source/UITracingLayerView.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | 5 | open class UITracingLayerView: UIView { 6 | private var scheduledWithLayout: (() -> Void)? 7 | 8 | open func schedule(layout f: @escaping () -> Void) { 9 | self.scheduledWithLayout = f 10 | self.setNeedsLayout() 11 | } 12 | 13 | override open var autoresizingMask: UIView.AutoresizingMask { 14 | get { 15 | return [] 16 | } set(value) { 17 | } 18 | } 19 | 20 | override open func layoutSubviews() { 21 | super.layoutSubviews() 22 | 23 | if let scheduledWithLayout = self.scheduledWithLayout { 24 | self.scheduledWithLayout = nil 25 | scheduledWithLayout() 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /submodules/Display/Source/UniversalMasterController.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/Display/Source/UniversalMasterController.swift -------------------------------------------------------------------------------- /submodules/Display/Source/UniversalTapRecognizer.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import UIKit.UIGestureRecognizerSubclass 3 | 4 | private class TimerTargetWrapper: NSObject { 5 | let f: () -> Void 6 | 7 | init(_ f: @escaping () -> Void) { 8 | self.f = f 9 | } 10 | 11 | @objc func timerEvent() { 12 | self.f() 13 | } 14 | } 15 | 16 | class UniversalTapRecognizer: UITapGestureRecognizer { 17 | private let tapMaxDelay: Double = 0.15 18 | 19 | private var timer: Timer? 20 | 21 | deinit { 22 | self.timer?.invalidate() 23 | } 24 | 25 | override func reset() { 26 | super.reset() 27 | 28 | self.timer?.invalidate() 29 | } 30 | 31 | override func touchesBegan(_ touches: Set, with event: UIEvent) { 32 | super.touchesBegan(touches, with: event) 33 | 34 | let timer = Timer(timeInterval: self.tapMaxDelay, target: TimerTargetWrapper({ [weak self] in 35 | if let strongSelf = self { 36 | if strongSelf.state != .ended { 37 | strongSelf.state = .failed 38 | } 39 | } 40 | }), selector: #selector(TimerTargetWrapper.timerEvent), userInfo: nil, repeats: false) 41 | self.timer = timer 42 | RunLoop.main.add(timer, forMode: .common) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /submodules/Display/Source/ViewControllerTracingNode.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | 5 | private final class ViewControllerTracingNodeView: UITracingLayerView { 6 | private var inHitTest = false 7 | var hitTestImpl: ((CGPoint, UIEvent?) -> UIView?)? 8 | 9 | override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { 10 | if self.inHitTest { 11 | return super.hitTest(point, with: event) 12 | } else { 13 | self.inHitTest = true 14 | let result = self.hitTestImpl?(point, event) 15 | self.inHitTest = false 16 | return result 17 | } 18 | } 19 | } 20 | 21 | open class ViewControllerTracingNode: ASDisplayNode { 22 | override public init() { 23 | super.init() 24 | 25 | self.setViewBlock({ 26 | return ViewControllerTracingNodeView() 27 | }) 28 | } 29 | 30 | override open func didLoad() { 31 | super.didLoad() 32 | 33 | (self.view as! ViewControllerTracingNodeView).hitTestImpl = { [weak self] point, event in 34 | return self?.hitTest(point, with: event) 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /submodules/Display/Source/WindowCoveringView.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | open class WindowCoveringView: UIView { 5 | open func updateLayout(_ size: CGSize) { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /submodules/Display/Source/WindowInputAccessoryHeightProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | public protocol WindowInputAccessoryHeightProvider: class { 5 | func getWindowInputAccessoryHeight() -> CGFloat 6 | } 7 | -------------------------------------------------------------------------------- /submodules/GZip/BUILD: -------------------------------------------------------------------------------- 1 | 2 | objc_library( 3 | name = "GZip", 4 | enable_modules = True, 5 | module_name = "GZip", 6 | srcs = glob([ 7 | "Sources/**/*.m", 8 | ]), 9 | hdrs = glob([ 10 | "Sources/**/*.h", 11 | ]), 12 | sdk_dylibs = [ 13 | "libz", 14 | ], 15 | visibility = [ 16 | "//visibility:public", 17 | ], 18 | ) 19 | -------------------------------------------------------------------------------- /submodules/GZip/Sources/GZip.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | //! Project version number for GZip. 4 | FOUNDATION_EXPORT double GZipVersionNumber; 5 | 6 | //! Project version string for GZip. 7 | FOUNDATION_EXPORT const unsigned char GZipVersionString[]; 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | NSData * _Nonnull TGGZipData(NSData * _Nonnull data, float level); 14 | NSData * _Nullable TGGUnzipData(NSData * _Nonnull data, uint sizeLimit); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /submodules/GlassButtonNode/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "GlassButtonNode", 5 | module_name = "GlassButtonNode", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | deps = [ 10 | "//submodules/AsyncDisplayKit:AsyncDisplayKit", 11 | "//submodules/Display:Display", 12 | ], 13 | visibility = [ 14 | "//visibility:public", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /submodules/LocalAuth/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "LocalAuth", 5 | module_name = "LocalAuth", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | deps = [ 10 | "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit", 11 | ], 12 | visibility = [ 13 | "//visibility:public", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /submodules/Markdown/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "Markdown", 5 | module_name = "Markdown", 6 | srcs = glob([ 7 | "Source/**/*.swift", 8 | ]), 9 | visibility = [ 10 | "//visibility:public", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /submodules/MergeLists/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "MergeLists", 5 | module_name = "MergeLists", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | visibility = [ 10 | "//visibility:public", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /submodules/MergeLists/Sources/Identifiable.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public protocol Identifiable { 4 | associatedtype T: Hashable 5 | var stableId: T { get } 6 | } 7 | 8 | public struct AnyIdentifiable { 9 | var stableId: AnyHashable 10 | 11 | public init(_ value: T) where T : Identifiable { 12 | self.stableId = value.stableId 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /submodules/NumberPluralizationForm/BUILD: -------------------------------------------------------------------------------- 1 | 2 | objc_library( 3 | name = "NumberPluralizationForm", 4 | enable_modules = True, 5 | module_name = "NumberPluralizationForm", 6 | srcs = glob([ 7 | "Sources/*.m", 8 | ]), 9 | hdrs = glob([ 10 | "PublicHeaders/**/*.h", 11 | ]), 12 | includes = [ 13 | "PublicHeaders", 14 | ], 15 | sdk_frameworks = [ 16 | "Foundation", 17 | ], 18 | visibility = [ 19 | "//visibility:public", 20 | ], 21 | ) 22 | -------------------------------------------------------------------------------- /submodules/NumberPluralizationForm/PublicHeaders/NumberPluralizationForm/NumberPluralizationForm.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | typedef NS_ENUM(int32_t, NumberPluralizationForm) { 4 | NumberPluralizationFormZero, 5 | NumberPluralizationFormOne, 6 | NumberPluralizationFormTwo, 7 | NumberPluralizationFormFew, 8 | NumberPluralizationFormMany, 9 | NumberPluralizationFormOther 10 | }; 11 | 12 | NumberPluralizationForm numberPluralizationForm(unsigned int lc, int n); 13 | -------------------------------------------------------------------------------- /submodules/ObjCRuntimeUtils/BUILD: -------------------------------------------------------------------------------- 1 | 2 | objc_library( 3 | name = "ObjCRuntimeUtils", 4 | enable_modules = True, 5 | module_name = "ObjCRuntimeUtils", 6 | srcs = glob([ 7 | "Source/ObjCRuntimeUtils/*.m", 8 | ]), 9 | hdrs = glob([ 10 | "Source/ObjCRuntimeUtils/*.h", 11 | ]), 12 | includes = [ 13 | "Source", 14 | ], 15 | sdk_frameworks = [ 16 | "Foundation", 17 | "UIKit", 18 | ], 19 | visibility = [ 20 | "//visibility:public", 21 | ], 22 | ) 23 | -------------------------------------------------------------------------------- /submodules/ObjCRuntimeUtils/Source/ObjCRuntimeUtils/RuntimeUtils.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | typedef enum { 5 | NSObjectAssociationPolicyRetain = 0, 6 | NSObjectAssociationPolicyCopy = 1 7 | } NSObjectAssociationPolicy; 8 | 9 | @interface RuntimeUtils : NSObject 10 | 11 | + (void)swizzleInstanceMethodOfClass:(Class)targetClass currentSelector:(SEL)currentSelector newSelector:(SEL)newSelector; 12 | + (void)swizzleInstanceMethodOfClass:(Class)targetClass currentSelector:(SEL)currentSelector withAnotherClass:(Class)anotherClass newSelector:(SEL)newSelector; 13 | + (void)swizzleClassMethodOfClass:(Class)targetClass currentSelector:(SEL)currentSelector newSelector:(SEL)newSelector; 14 | + (CALayer * _Nonnull)makeLayerHostCopy:(CALayer * _Nonnull)another; 15 | 16 | @end 17 | 18 | @interface NSObject (AssociatedObject) 19 | 20 | - (void)setAssociatedObject:(id)object forKey:(void const *)key; 21 | - (void)setAssociatedObject:(id)object forKey:(void const *)key associationPolicy:(NSObjectAssociationPolicy)associationPolicy; 22 | - (id)associatedObjectForKey:(void const *)key; 23 | - (bool)checkObjectIsKindOfClass:(Class)targetClass; 24 | - (void)setClass:(Class)newClass; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /submodules/OverlayStatusController/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | filegroup( 4 | name = "OverlayStatusControllerResources", 5 | srcs = glob([ 6 | "Resources/**/*", 7 | ], exclude = ["Resources/**/.*"]), 8 | visibility = ["//visibility:public"], 9 | ) 10 | 11 | swift_library( 12 | name = "OverlayStatusController", 13 | module_name = "OverlayStatusController", 14 | srcs = glob([ 15 | "Sources/**/*.swift", 16 | ]), 17 | deps = [ 18 | "//submodules/Display:Display", 19 | "//submodules/OverlayStatusController/Impl:OverlayStatusControllerImpl" 20 | ], 21 | visibility = [ 22 | "//visibility:public", 23 | ], 24 | ) 25 | -------------------------------------------------------------------------------- /submodules/OverlayStatusController/Impl/BUILD: -------------------------------------------------------------------------------- 1 | 2 | objc_library( 3 | name = "OverlayStatusControllerImpl", 4 | module_name = "OverlayStatusControllerImpl", 5 | srcs = glob([ 6 | "Sources/**/*.m", 7 | ]), 8 | hdrs = glob([ 9 | "Sources/**/*.h", 10 | ]), 11 | includes = [ 12 | "Sources", 13 | ], 14 | visibility = [ 15 | "//visibility:public", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /submodules/OverlayStatusController/Impl/Sources/OverlayStatusControllerImpl/ProgressSpinnerView.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface ProgressSpinnerView : UIView 4 | 5 | @property (nonatomic, copy) void (^onSuccess)(void); 6 | 7 | - (instancetype)initWithFrame:(CGRect)frame light:(bool)light; 8 | 9 | - (void)setProgress; 10 | - (void)setSucceed; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /submodules/OverlayStatusController/Impl/Sources/OverlayStatusControllerImpl/ProgressWindow.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface ProgressWindowController : UIViewController 4 | 5 | @property (nonatomic, copy) void (^cancelled)(void); 6 | 7 | - (instancetype)init; 8 | - (instancetype)initWithLight:(bool)light; 9 | 10 | - (void)show:(bool)animated; 11 | - (void)dismiss:(bool)animated completion:(void (^)(void))completion; 12 | - (void)dismissWithSuccess:(void (^)(void))completion; 13 | 14 | - (void)updateLayout; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /submodules/OverlayStatusController/Impl/Sources/OverlayStatusControllerImpl/ProxyWindow.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface ProxyWindowController : UIViewController 4 | 5 | - (instancetype)initWithLight:(bool)light text:(NSString *)text icon:(UIImage *)icon isShield:(bool)isShield showCheck:(bool)showCheck; 6 | 7 | - (void)dismissWithSuccess:(void (^)(void))completion increasedDelay:(bool)increasedDelay; 8 | - (void)updateLayout; 9 | 10 | + (UIImage *)generateShieldImage:(bool)isLight; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /submodules/ProgressNavigationButtonNode/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "ProgressNavigationButtonNode", 5 | module_name = "ProgressNavigationButtonNode", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | deps = [ 10 | "//submodules/Display:Display", 11 | "//submodules/AsyncDisplayKit:AsyncDisplayKit", 12 | "//submodules/ActivityIndicator:ActivityIndicator", 13 | ], 14 | visibility = [ 15 | "//visibility:public", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /submodules/ProgressNavigationButtonNode/Sources/ProgressNavigationButtonNode.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | import Display 5 | import ActivityIndicator 6 | 7 | public final class ProgressNavigationButtonNode: ASDisplayNode { 8 | private var indicatorNode: ActivityIndicator 9 | 10 | public init(color: UIColor) { 11 | self.indicatorNode = ActivityIndicator(type: .custom(color, 22.0, 1.0, false)) 12 | 13 | super.init() 14 | 15 | self.addSubnode(self.indicatorNode) 16 | } 17 | 18 | override public func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize { 19 | return CGSize(width: 26.0, height: 22.0) 20 | } 21 | 22 | override public func layout() { 23 | super.layout() 24 | 25 | let size = self.bounds.size 26 | 27 | let indicatorSize = CGSize(width: 22.0, height: 22.0) 28 | self.indicatorNode.frame = CGRect(origin: CGPoint(x: floor((size.width - indicatorSize.width) / 2.0), y: floor((size.height - indicatorSize.height) / 2.0)), size: indicatorSize) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /submodules/QrCode/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "QrCode", 5 | module_name = "QrCode", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | deps = [ 10 | "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit", 11 | "//submodules/Display:Display", 12 | ], 13 | visibility = [ 14 | "//visibility:public", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/BUILD: -------------------------------------------------------------------------------- 1 | 2 | objc_library( 3 | name = "SSignalKit", 4 | enable_modules = True, 5 | module_name = "SSignalKit", 6 | srcs = glob([ 7 | "Source/SSignalKit/*.m", 8 | ]), 9 | hdrs = glob([ 10 | "Source/SSignalKit/*.h", 11 | ]), 12 | includes = [ 13 | "Source", 14 | ], 15 | sdk_frameworks = [ 16 | "Foundation", 17 | ], 18 | visibility = [ 19 | "//visibility:public", 20 | ], 21 | ) 22 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SAtomic.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SAtomic : NSObject 4 | 5 | - (instancetype)initWithValue:(id)value; 6 | - (instancetype)initWithValue:(id)value recursive:(bool)recursive; 7 | - (id)swap:(id)newValue; 8 | - (id)value; 9 | - (id)modify:(id (^)(id))f; 10 | - (id)with:(id (^)(id))f; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SBag.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SBag : NSObject 4 | 5 | - (NSInteger)addItem:(id)item; 6 | - (void)enumerateItems:(void (^)(id))block; 7 | - (void)removeItem:(NSInteger)key; 8 | - (bool)isEmpty; 9 | - (NSArray *)copyItems; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SBag.m: -------------------------------------------------------------------------------- 1 | #import "SBag.h" 2 | 3 | @interface SBag () 4 | { 5 | NSInteger _nextKey; 6 | NSMutableArray *_items; 7 | NSMutableArray *_itemKeys; 8 | } 9 | 10 | @end 11 | 12 | @implementation SBag 13 | 14 | - (instancetype)init 15 | { 16 | self = [super init]; 17 | if (self != nil) 18 | { 19 | _items = [[NSMutableArray alloc] init]; 20 | _itemKeys = [[NSMutableArray alloc] init]; 21 | } 22 | return self; 23 | } 24 | 25 | - (NSInteger)addItem:(id)item 26 | { 27 | if (item == nil) 28 | return -1; 29 | 30 | NSInteger key = _nextKey; 31 | [_items addObject:item]; 32 | [_itemKeys addObject:@(key)]; 33 | _nextKey++; 34 | 35 | return key; 36 | } 37 | 38 | - (void)enumerateItems:(void (^)(id))block 39 | { 40 | if (block) 41 | { 42 | for (id item in _items) 43 | { 44 | block(item); 45 | } 46 | } 47 | } 48 | 49 | - (void)removeItem:(NSInteger)key 50 | { 51 | NSUInteger index = 0; 52 | for (NSNumber *itemKey in _itemKeys) 53 | { 54 | if ([itemKey integerValue] == key) 55 | { 56 | [_items removeObjectAtIndex:index]; 57 | [_itemKeys removeObjectAtIndex:index]; 58 | break; 59 | } 60 | index++; 61 | } 62 | } 63 | 64 | - (bool)isEmpty 65 | { 66 | return _items.count == 0; 67 | } 68 | 69 | - (NSArray *)copyItems 70 | { 71 | return [[NSArray alloc] initWithArray:_items]; 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SBlockDisposable.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SBlockDisposable : NSObject 4 | 5 | - (instancetype)initWithBlock:(void (^)())block; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SBlockDisposable.m: -------------------------------------------------------------------------------- 1 | #import "SBlockDisposable.h" 2 | 3 | #import 4 | #import 5 | 6 | @interface SBlockDisposable () 7 | { 8 | void *_block; 9 | } 10 | 11 | @end 12 | 13 | @implementation SBlockDisposable 14 | 15 | - (instancetype)initWithBlock:(void (^)())block 16 | { 17 | self = [super init]; 18 | if (self != nil) 19 | { 20 | _block = (__bridge_retained void *)[block copy]; 21 | } 22 | return self; 23 | } 24 | 25 | - (void)dealloc 26 | { 27 | void *block = _block; 28 | if (block != NULL) 29 | { 30 | if (OSAtomicCompareAndSwapPtr(block, 0, &_block)) 31 | { 32 | if (block != nil) 33 | { 34 | __strong id strongBlock = (__bridge_transfer id)block; 35 | strongBlock = nil; 36 | } 37 | } 38 | } 39 | } 40 | 41 | - (void)dispose 42 | { 43 | void *block = _block; 44 | if (block != NULL) 45 | { 46 | if (OSAtomicCompareAndSwapPtr(block, 0, &_block)) 47 | { 48 | if (block != nil) 49 | { 50 | __strong id strongBlock = (__bridge_transfer id)block; 51 | ((dispatch_block_t)strongBlock)(); 52 | strongBlock = nil; 53 | } 54 | } 55 | } 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SDisposable.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @protocol SDisposable 4 | 5 | - (void)dispose; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SDisposableSet.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class SSignal; 4 | 5 | @interface SDisposableSet : NSObject 6 | 7 | - (void)add:(id)disposable; 8 | - (void)remove:(id)disposable; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SMetaDisposable.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SMetaDisposable : NSObject 4 | 5 | - (void)setDisposable:(id)disposable; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SMetaDisposable.m: -------------------------------------------------------------------------------- 1 | #import "SMetaDisposable.h" 2 | 3 | #import 4 | 5 | @interface SMetaDisposable () 6 | { 7 | OSSpinLock _lock; 8 | bool _disposed; 9 | id _disposable; 10 | } 11 | 12 | @end 13 | 14 | @implementation SMetaDisposable 15 | 16 | - (void)setDisposable:(id)disposable 17 | { 18 | id previousDisposable = nil; 19 | bool dispose = false; 20 | 21 | OSSpinLockLock(&_lock); 22 | dispose = _disposed; 23 | if (!dispose) 24 | { 25 | previousDisposable = _disposable; 26 | _disposable = disposable; 27 | } 28 | OSSpinLockUnlock(&_lock); 29 | 30 | if (previousDisposable != nil) 31 | [previousDisposable dispose]; 32 | 33 | if (dispose) 34 | [disposable dispose]; 35 | } 36 | 37 | - (void)dispose 38 | { 39 | id disposable = nil; 40 | 41 | OSSpinLockLock(&_lock); 42 | if (!_disposed) 43 | { 44 | disposable = _disposable; 45 | _disposed = true; 46 | } 47 | OSSpinLockUnlock(&_lock); 48 | 49 | if (disposable != nil) 50 | [disposable dispose]; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SMulticastSignalManager.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SMulticastSignalManager : NSObject 4 | 5 | - (SSignal *)multicastedSignalForKey:(NSString *)key producer:(SSignal *(^)())producer; 6 | - (void)startStandaloneSignalIfNotRunningForKey:(NSString *)key producer:(SSignal *(^)())producer; 7 | 8 | - (SSignal *)multicastedPipeForKey:(NSString *)key; 9 | - (void)putNext:(id)next toMulticastedPipeForKey:(NSString *)key; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SQueue.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SQueue : NSObject 4 | 5 | + (SQueue *)mainQueue; 6 | + (SQueue *)concurrentDefaultQueue; 7 | + (SQueue *)concurrentBackgroundQueue; 8 | 9 | + (SQueue *)wrapConcurrentNativeQueue:(dispatch_queue_t)nativeQueue; 10 | 11 | - (void)dispatch:(dispatch_block_t)block; 12 | - (void)dispatchSync:(dispatch_block_t)block; 13 | - (void)dispatch:(dispatch_block_t)block synchronous:(bool)synchronous; 14 | 15 | - (dispatch_queue_t)_dispatch_queue; 16 | 17 | - (bool)isCurrentQueue; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+Accumulate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SSignal (Accumulate) 4 | 5 | - (SSignal *)reduceLeft:(id)value with:(id (^)(id, id))f; 6 | - (SSignal *)reduceLeftWithPassthrough:(id)value with:(id (^)(id, id, void (^)(id)))f; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+Accumulate.m: -------------------------------------------------------------------------------- 1 | #import "SSignal+Accumulate.h" 2 | 3 | @implementation SSignal (Accumulate) 4 | 5 | - (SSignal *)reduceLeft:(id)value with:(id (^)(id, id))f 6 | { 7 | return [[SSignal alloc] initWithGenerator:^(SSubscriber *subscriber) 8 | { 9 | __block id intermediateResult = value; 10 | 11 | return [self startWithNext:^(id next) 12 | { 13 | intermediateResult = f(intermediateResult, next); 14 | } error:^(id error) 15 | { 16 | [subscriber putError:error]; 17 | } completed:^ 18 | { 19 | if (intermediateResult != nil) 20 | [subscriber putNext:intermediateResult]; 21 | [subscriber putCompletion]; 22 | }]; 23 | }]; 24 | } 25 | 26 | - (SSignal *)reduceLeftWithPassthrough:(id)value with:(id (^)(id, id, void (^)(id)))f 27 | { 28 | return [[SSignal alloc] initWithGenerator:^(SSubscriber *subscriber) 29 | { 30 | __block id intermediateResult = value; 31 | 32 | void (^emit)(id) = ^(id next) 33 | { 34 | [subscriber putNext:next]; 35 | }; 36 | 37 | return [self startWithNext:^(id next) 38 | { 39 | intermediateResult = f(intermediateResult, next, emit); 40 | } error:^(id error) 41 | { 42 | [subscriber putError:error]; 43 | } completed:^ 44 | { 45 | if (intermediateResult != nil) 46 | [subscriber putNext:intermediateResult]; 47 | [subscriber putCompletion]; 48 | }]; 49 | }]; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+Catch.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SSignal (Catch) 4 | 5 | - (SSignal *)catch:(SSignal *(^)(id error))f; 6 | - (SSignal *)restart; 7 | - (SSignal *)retryIf:(bool (^)(id error))predicate; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+Combine.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SSignal (Combine) 4 | 5 | + (SSignal *)combineSignals:(NSArray *)signals; 6 | + (SSignal *)combineSignals:(NSArray *)signals withInitialStates:(NSArray *)initialStates; 7 | 8 | + (SSignal *)mergeSignals:(NSArray *)signals; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+Dispatch.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import 4 | #import 5 | 6 | @interface SSignal (Dispatch) 7 | 8 | - (SSignal *)deliverOn:(SQueue *)queue; 9 | - (SSignal *)deliverOnThreadPool:(SThreadPool *)threadPool; 10 | - (SSignal *)startOn:(SQueue *)queue; 11 | - (SSignal *)startOnThreadPool:(SThreadPool *)threadPool; 12 | - (SSignal *)throttleOn:(SQueue *)queue delay:(NSTimeInterval)delay; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+Mapping.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SSignal (Mapping) 4 | 5 | - (SSignal *)map:(id (^)(id))f; 6 | - (SSignal *)filter:(bool (^)(id))f; 7 | - (SSignal *)ignoreRepeated; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+Meta.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class SQueue; 4 | 5 | @interface SSignal (Meta) 6 | 7 | - (SSignal *)switchToLatest; 8 | - (SSignal *)mapToSignal:(SSignal *(^)(id))f; 9 | - (SSignal *)mapToQueue:(SSignal *(^)(id))f; 10 | - (SSignal *)mapToThrottled:(SSignal *(^)(id))f; 11 | - (SSignal *)then:(SSignal *)signal; 12 | - (SSignal *)queue; 13 | - (SSignal *)throttled; 14 | + (SSignal *)defer:(SSignal *(^)())generator; 15 | 16 | @end 17 | 18 | @interface SSignalQueue : NSObject 19 | 20 | - (SSignal *)enqueue:(SSignal *)signal; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+Multicast.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SSignal (Multicast) 4 | 5 | - (SSignal *)multicast; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+Pipe.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SPipe : NSObject 4 | 5 | @property (nonatomic, copy, readonly) SSignal *(^signalProducer)(); 6 | @property (nonatomic, copy, readonly) void (^sink)(id); 7 | 8 | - (instancetype)initWithReplay:(bool)replay; 9 | 10 | @end 11 | 12 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+SideEffects.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SSignal (SideEffects) 4 | 5 | - (SSignal *)onStart:(void (^)())f; 6 | - (SSignal *)onNext:(void (^)(id next))f; 7 | - (SSignal *)afterNext:(void (^)(id next))f; 8 | - (SSignal *)onError:(void (^)(id error))f; 9 | - (SSignal *)onCompletion:(void (^)())f; 10 | - (SSignal *)afterCompletion:(void (^)())f; 11 | - (SSignal *)onDispose:(void (^)())f; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+Single.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SSignal (Single) 4 | 5 | + (SSignal *)single:(id)next; 6 | + (SSignal *)fail:(id)error; 7 | + (SSignal *)never; 8 | + (SSignal *)complete; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+Single.m: -------------------------------------------------------------------------------- 1 | #import "SSignal+Single.h" 2 | 3 | @implementation SSignal (Single) 4 | 5 | + (SSignal *)single:(id)next 6 | { 7 | return [[SSignal alloc] initWithGenerator:^id (SSubscriber *subscriber) 8 | { 9 | [subscriber putNext:next]; 10 | [subscriber putCompletion]; 11 | return nil; 12 | }]; 13 | } 14 | 15 | + (SSignal *)fail:(id)error 16 | { 17 | return [[SSignal alloc] initWithGenerator:^id (SSubscriber *subscriber) 18 | { 19 | [subscriber putError:error]; 20 | return nil; 21 | }]; 22 | } 23 | 24 | + (SSignal *)never 25 | { 26 | return [[SSignal alloc] initWithGenerator:^id (__unused SSubscriber *subscriber) 27 | { 28 | return nil; 29 | }]; 30 | } 31 | 32 | + (SSignal *)complete 33 | { 34 | return [[SSignal alloc] initWithGenerator:^id (SSubscriber *subscriber) 35 | { 36 | [subscriber putCompletion]; 37 | return nil; 38 | }]; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+Take.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SSignal (Take) 4 | 5 | - (SSignal *)take:(NSUInteger)count; 6 | - (SSignal *)takeLast; 7 | - (SSignal *)takeUntilReplacement:(SSignal *)replacement; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal+Timing.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import 4 | 5 | @interface SSignal (Timing) 6 | 7 | - (SSignal *)delay:(NSTimeInterval)seconds onQueue:(SQueue *)queue; 8 | - (SSignal *)timeout:(NSTimeInterval)seconds onQueue:(SQueue *)queue orSignal:(SSignal *)signal; 9 | - (SSignal *)wait:(NSTimeInterval)seconds; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignal.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SSignal : NSObject 4 | { 5 | @public 6 | id (^_generator)(SSubscriber *); 7 | } 8 | 9 | - (instancetype)initWithGenerator:(id (^)(SSubscriber *))generator; 10 | 11 | - (id)startWithNext:(void (^)(id next))next error:(void (^)(id error))error completed:(void (^)())completed; 12 | - (id)startWithNext:(void (^)(id next))next; 13 | - (id)startWithNext:(void (^)(id next))next completed:(void (^)())completed; 14 | 15 | - (SSignal *)trace:(NSString *)name; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSignalKit.h: -------------------------------------------------------------------------------- 1 | #if __IPHONE_OS_VERSION_MIN_REQUIRED 2 | #import 3 | #else 4 | #import 5 | #endif 6 | 7 | //! Project version number for SSignalKit. 8 | FOUNDATION_EXPORT double SSignalKitVersionNumber; 9 | 10 | //! Project version string for SSignalKit. 11 | FOUNDATION_EXPORT const unsigned char SSignalKitVersionString[]; 12 | 13 | // In this header, you should import all the public headers of your framework using statements like #import 14 | 15 | #import 16 | #import 17 | #import 18 | #import 19 | #import 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import 32 | #import 33 | #import 34 | #import 35 | #import 36 | #import 37 | #import 38 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SSubscriber.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SSubscriber : NSObject 4 | { 5 | } 6 | 7 | - (instancetype)initWithNext:(void (^)(id))next error:(void (^)(id))error completed:(void (^)())completed; 8 | 9 | - (void)_assignDisposable:(id)disposable; 10 | - (void)_markTerminatedWithoutDisposal; 11 | 12 | - (void)putNext:(id)next; 13 | - (void)putError:(id)error; 14 | - (void)putCompletion; 15 | 16 | @end 17 | 18 | @interface STracingSubscriber : SSubscriber 19 | 20 | - (instancetype)initWithName:(NSString *)name next:(void (^)(id))next error:(void (^)(id))error completed:(void (^)())completed; 21 | 22 | @end -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SThreadPool.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import 4 | #import 5 | 6 | @interface SThreadPool : NSObject 7 | 8 | - (instancetype)initWithThreadCount:(NSUInteger)threadCount threadPriority:(double)threadPriority; 9 | 10 | - (void)addTask:(SThreadPoolTask *)task; 11 | 12 | - (SThreadPoolQueue *)nextQueue; 13 | - (void)_workOnQueue:(SThreadPoolQueue *)queue block:(void (^)())block; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SThreadPoolQueue.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class SThreadPool; 4 | @class SThreadPoolTask; 5 | 6 | @interface SThreadPoolQueue : NSObject 7 | 8 | - (instancetype)initWithThreadPool:(SThreadPool *)threadPool; 9 | - (void)addTask:(SThreadPoolTask *)task; 10 | - (SThreadPoolTask *)_popFirstTask; 11 | - (bool)_hasTasks; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SThreadPoolQueue.m: -------------------------------------------------------------------------------- 1 | #import "SThreadPoolQueue.h" 2 | 3 | #import "SThreadPool.h" 4 | 5 | @interface SThreadPoolQueue () 6 | { 7 | __weak SThreadPool *_threadPool; 8 | NSMutableArray *_tasks; 9 | } 10 | 11 | @end 12 | 13 | @implementation SThreadPoolQueue 14 | 15 | - (instancetype)initWithThreadPool:(SThreadPool *)threadPool 16 | { 17 | self = [super init]; 18 | if (self != nil) 19 | { 20 | _threadPool = threadPool; 21 | _tasks = [[NSMutableArray alloc] init]; 22 | } 23 | return self; 24 | } 25 | 26 | - (void)addTask:(SThreadPoolTask *)task 27 | { 28 | SThreadPool *threadPool = _threadPool; 29 | [threadPool _workOnQueue:self block:^ 30 | { 31 | [_tasks addObject:task]; 32 | }]; 33 | } 34 | 35 | - (SThreadPoolTask *)_popFirstTask 36 | { 37 | if (_tasks.count != 0) 38 | { 39 | SThreadPoolTask *task = _tasks[0]; 40 | [_tasks removeObjectAtIndex:0]; 41 | return task; 42 | } 43 | return nil; 44 | } 45 | 46 | - (bool)_hasTasks 47 | { 48 | return _tasks.count != 0; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SThreadPoolTask.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SThreadPoolTask : NSObject 4 | 5 | - (instancetype)initWithBlock:(void (^)(bool (^)()))block; 6 | - (void)execute; 7 | - (void)cancel; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SThreadPoolTask.m: -------------------------------------------------------------------------------- 1 | #import "SThreadPoolTask.h" 2 | 3 | @interface SThreadPoolTaskState : NSObject 4 | { 5 | @public 6 | bool _cancelled; 7 | } 8 | 9 | @end 10 | 11 | @implementation SThreadPoolTaskState 12 | 13 | @end 14 | 15 | @interface SThreadPoolTask () 16 | { 17 | void (^_block)(bool (^)()); 18 | SThreadPoolTaskState *_state; 19 | } 20 | 21 | @end 22 | 23 | @implementation SThreadPoolTask 24 | 25 | - (instancetype)initWithBlock:(void (^)(bool (^)()))block 26 | { 27 | self = [super init]; 28 | if (self != nil) 29 | { 30 | _block = [block copy]; 31 | _state = [[SThreadPoolTaskState alloc] init]; 32 | } 33 | return self; 34 | } 35 | 36 | - (void)execute 37 | { 38 | if (_state->_cancelled) 39 | return; 40 | 41 | SThreadPoolTaskState *state = _state; 42 | _block(^bool 43 | { 44 | return state->_cancelled; 45 | }); 46 | } 47 | 48 | - (void)cancel 49 | { 50 | _state->_cancelled = true; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/STimer.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class SQueue; 4 | 5 | @interface STimer : NSObject 6 | 7 | - (id)initWithTimeout:(NSTimeInterval)timeout repeat:(bool)repeat completion:(dispatch_block_t)completion queue:(SQueue *)queue; 8 | - (id)initWithTimeout:(NSTimeInterval)timeout repeat:(bool)repeat completion:(dispatch_block_t)completion nativeQueue:(dispatch_queue_t)nativeQueue; 9 | 10 | - (void)start; 11 | - (void)invalidate; 12 | - (void)fireAndInvalidate; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SSignalKit/Source/SSignalKit/SVariable.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class SSignal; 4 | 5 | @interface SVariable : NSObject 6 | 7 | - (instancetype)init; 8 | 9 | - (void)set:(SSignal *)signal; 10 | - (SSignal *)signal; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SwiftSignalKit/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "SwiftSignalKit", 5 | module_name = "SwiftSignalKit", 6 | srcs = glob([ 7 | "Source/**/*.swift", 8 | ]), 9 | visibility = [ 10 | "//visibility:public", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SwiftSignalKit/Source/Atomic.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public final class Atomic { 4 | private var lock: pthread_mutex_t 5 | private var value: T 6 | 7 | public init(value: T) { 8 | self.lock = pthread_mutex_t() 9 | self.value = value 10 | 11 | pthread_mutex_init(&self.lock, nil) 12 | } 13 | 14 | deinit { 15 | pthread_mutex_destroy(&self.lock) 16 | } 17 | 18 | public func with(_ f: (T) -> R) -> R { 19 | pthread_mutex_lock(&self.lock) 20 | let result = f(self.value) 21 | pthread_mutex_unlock(&self.lock) 22 | 23 | return result 24 | } 25 | 26 | public func modify(_ f: (T) -> T) -> T { 27 | pthread_mutex_lock(&self.lock) 28 | let result = f(self.value) 29 | self.value = result 30 | pthread_mutex_unlock(&self.lock) 31 | 32 | return result 33 | } 34 | 35 | public func swap(_ value: T) -> T { 36 | pthread_mutex_lock(&self.lock) 37 | let previous = self.value 38 | self.value = value 39 | pthread_mutex_unlock(&self.lock) 40 | 41 | return previous 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SwiftSignalKit/Source/Lock.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public final class Lock { 4 | private var mutex = pthread_mutex_t() 5 | 6 | public init() { 7 | pthread_mutex_init(&self.mutex, nil) 8 | } 9 | 10 | deinit { 11 | pthread_mutex_destroy(&self.mutex) 12 | } 13 | 14 | public func locked(_ f: () -> ()) { 15 | pthread_mutex_lock(&self.mutex) 16 | f() 17 | pthread_mutex_unlock(&self.mutex) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SwiftSignalKit/Source/Signal_Loop.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum SignalFeedbackLoopState { 4 | case initial 5 | case loop(T) 6 | } 7 | 8 | public func feedbackLoop(once: @escaping (SignalFeedbackLoopState) -> Signal?, reduce: @escaping (R1, R1) -> R1) -> Signal { 9 | return Signal { subscriber in 10 | let currentDisposable = MetaDisposable() 11 | 12 | let state = Atomic(value: nil) 13 | 14 | var loopAgain: (() -> Void)? 15 | 16 | let loopOnce: (MetaDisposable?) -> Void = { disposable in 17 | if let signal = once(.initial) { 18 | disposable?.set(signal.start(next: { next in 19 | let _ = state.modify { value in 20 | if let value = value { 21 | return reduce(value, next) 22 | } else { 23 | return value 24 | } 25 | } 26 | }, error: { error in 27 | subscriber.putError(error) 28 | }, completed: { 29 | loopAgain?() 30 | })) 31 | } else { 32 | subscriber.putCompletion() 33 | } 34 | } 35 | 36 | loopAgain = { [weak currentDisposable] in 37 | loopOnce(currentDisposable) 38 | } 39 | 40 | loopOnce(currentDisposable) 41 | 42 | return ActionDisposable { 43 | currentDisposable.dispose() 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SwiftSignalKit/Source/Signal_Materialize.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum SignalEvent { 4 | case Next(T) 5 | case Error(E) 6 | case Completion 7 | } 8 | 9 | public func dematerialize(signal: Signal) -> Signal, NoError> { 10 | return Signal { subscriber in 11 | return signal.start(next: { next in 12 | subscriber.putNext(.Next(next)) 13 | }, error: { error in 14 | subscriber.putNext(.Error(error)) 15 | subscriber.putCompletion() 16 | }, completed: { 17 | subscriber.putNext(.Completion) 18 | subscriber.putCompletion() 19 | }) 20 | } 21 | } 22 | 23 | public func materialize(signal: Signal, NoError>) -> Signal { 24 | return Signal { subscriber in 25 | return signal.start(next: { next in 26 | switch next { 27 | case let .Next(next): 28 | subscriber.putNext(next) 29 | case let .Error(error): 30 | subscriber.putError(error) 31 | case .Completion: 32 | subscriber.putCompletion() 33 | } 34 | }, error: { _ in 35 | subscriber.putCompletion() 36 | }, completed: { 37 | subscriber.putCompletion() 38 | }) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SwiftSignalKit/Source/Signal_Merge.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /*public func merge(signal1: Signal, signal2: Signal) -> Signal { 4 | return Signal { subscriber in 5 | 6 | } 7 | }*/ 8 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SwiftSignalKit/Source/Signal_Single.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public func single(_ value: T, _ errorType: E.Type) -> Signal { 4 | return Signal { subscriber in 5 | subscriber.putNext(value) 6 | subscriber.putCompletion() 7 | 8 | return EmptyDisposable 9 | } 10 | } 11 | 12 | public func fail(_ valueType: T.Type, _ error: E) -> Signal { 13 | return Signal { subscriber in 14 | subscriber.putError(error) 15 | 16 | return EmptyDisposable 17 | } 18 | } 19 | 20 | public func complete(_ valueType: T.Type, _ error: E.Type) -> Signal { 21 | return Signal { subscriber in 22 | subscriber.putCompletion() 23 | 24 | return EmptyDisposable 25 | } 26 | } 27 | 28 | public func never(_ valueType: T.Type, _ error: E.Type) -> Signal { 29 | return Signal { _ in 30 | return EmptyDisposable 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SwiftSignalKit/Source/Timer.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public final class Timer { 4 | private let timer = Atomic(value: nil) 5 | private let timeout: Double 6 | private let `repeat`: Bool 7 | private let completion: () -> Void 8 | private let queue: Queue 9 | 10 | public init(timeout: Double, `repeat`: Bool, completion: @escaping() -> Void, queue: Queue) { 11 | self.timeout = timeout 12 | self.`repeat` = `repeat` 13 | self.completion = completion 14 | self.queue = queue 15 | } 16 | 17 | deinit { 18 | self.invalidate() 19 | } 20 | 21 | public func start() { 22 | let timer = DispatchSource.makeTimerSource(queue: self.queue.queue) 23 | timer.setEventHandler(handler: { [weak self] in 24 | if let strongSelf = self { 25 | strongSelf.completion() 26 | if !strongSelf.`repeat` { 27 | strongSelf.invalidate() 28 | } 29 | } 30 | }) 31 | let _ = self.timer.modify { _ in 32 | return timer 33 | } 34 | 35 | if self.`repeat` { 36 | let time: DispatchTime = DispatchTime.now() + self.timeout 37 | timer.schedule(deadline: time, repeating: self.timeout) 38 | } else { 39 | let time: DispatchTime = DispatchTime.now() + self.timeout 40 | timer.schedule(deadline: time) 41 | } 42 | 43 | timer.resume() 44 | } 45 | 46 | public func invalidate() { 47 | let _ = self.timer.modify { timer in 48 | timer?.cancel() 49 | return nil 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /submodules/SSignalKit/SwiftSignalKit/Source/ValuePipe.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public final class ValuePipe { 4 | private let subscribers = Atomic(value: Bag<(T) -> Void>()) 5 | 6 | public init() { 7 | } 8 | 9 | public func signal() -> Signal { 10 | return Signal { [weak self] subscriber in 11 | if let strongSelf = self { 12 | let index = strongSelf.subscribers.with { value -> Bag.Index in 13 | return value.add { next in 14 | subscriber.putNext(next) 15 | } 16 | } 17 | 18 | return ActionDisposable { [weak strongSelf] in 19 | if let strongSelf = strongSelf { 20 | strongSelf.subscribers.with { value -> Void in 21 | value.remove(index) 22 | } 23 | } 24 | } 25 | } else { 26 | return EmptyDisposable 27 | } 28 | } 29 | } 30 | 31 | public func putNext(_ next: T) { 32 | let items = self.subscribers.with { value -> [(T) -> Void] in 33 | return value.copyItems() 34 | } 35 | for f in items { 36 | f(next) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /submodules/ScreenCaptureDetection/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "ScreenCaptureDetection", 5 | module_name = "ScreenCaptureDetection", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | deps = [ 10 | "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit", 11 | ], 12 | visibility = [ 13 | "//visibility:public", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /submodules/SolidRoundedButtonNode/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "SolidRoundedButtonNode", 5 | module_name = "SolidRoundedButtonNode", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | deps = [ 10 | "//submodules/AsyncDisplayKit:AsyncDisplayKit", 11 | "//submodules/Display:Display", 12 | ], 13 | visibility = [ 14 | "//visibility:public", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /submodules/StringPluralization/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "StringPluralization", 5 | module_name = "StringPluralization", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | deps = [ 10 | "//submodules/NumberPluralizationForm:NumberPluralizationForm", 11 | "//submodules/AppBundle:AppBundle", 12 | ], 13 | visibility = [ 14 | "//visibility:public", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /submodules/StringPluralization/Sources/StringPluralization.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import NumberPluralizationForm 3 | 4 | public enum PluralizationForm: Int32 { 5 | case zero = 0 6 | case one = 1 7 | case two = 2 8 | case few = 3 9 | case many = 4 10 | case other = 5 11 | 12 | var name: String { 13 | switch self { 14 | case .zero: 15 | return "zero" 16 | case .one: 17 | return "one" 18 | case .two: 19 | return "two" 20 | case .few: 21 | return "few" 22 | case .many: 23 | return "many" 24 | case .other: 25 | return "other" 26 | } 27 | } 28 | } 29 | 30 | public func getPluralizationForm(_ lc: UInt32, _ value: Int32) -> PluralizationForm { 31 | switch numberPluralizationForm(lc, value) { 32 | case .zero: 33 | return .zero 34 | case .one: 35 | return .one 36 | case .two: 37 | return .two 38 | case .few: 39 | return .few 40 | case .many: 41 | return .many 42 | case .other: 43 | return .other 44 | @unknown default: 45 | fatalError() 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /submodules/TonBinding/BUILD: -------------------------------------------------------------------------------- 1 | objc_library( 2 | name = "TonBinding", 3 | module_name = "TonBinding", 4 | enable_modules = True, 5 | srcs = glob([ 6 | "Sources/**/*.m", 7 | "Sources/**/*.mm", 8 | ]), 9 | hdrs = glob([ 10 | "Sources/**/*.h", 11 | ]), 12 | copts = [ 13 | "-std=c++14", 14 | ], 15 | includes = [ 16 | "Sources", 17 | ], 18 | deps = [ 19 | "//submodules/SSignalKit/SSignalKit:SSignalKit", 20 | "//submodules/openssl:openssl", 21 | "//submodules/ton:ton", 22 | ], 23 | visibility = [ 24 | "//visibility:public", 25 | ], 26 | ) 27 | -------------------------------------------------------------------------------- /submodules/UIKitRuntimeUtils/BUILD: -------------------------------------------------------------------------------- 1 | 2 | objc_library( 3 | name = "UIKitRuntimeUtils", 4 | enable_modules = True, 5 | module_name = "UIKitRuntimeUtils", 6 | srcs = glob([ 7 | "Source/UIKitRuntimeUtils/*.m", 8 | ]), 9 | hdrs = glob([ 10 | "Source/UIKitRuntimeUtils/*.h", 11 | ]), 12 | includes = [ 13 | #"Source", 14 | ], 15 | deps = [ 16 | "//submodules/AsyncDisplayKit:AsyncDisplayKit", 17 | "//submodules/ObjCRuntimeUtils:ObjCRuntimeUtils", 18 | ], 19 | sdk_frameworks = [ 20 | "Foundation", 21 | "UIKit", 22 | ], 23 | visibility = [ 24 | "//visibility:public", 25 | ], 26 | ) 27 | -------------------------------------------------------------------------------- /submodules/UIKitRuntimeUtils/Source/UIKitRuntimeUtils/NSBag.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSBag : NSObject 4 | 5 | - (NSInteger)addItem:(id)item; 6 | - (void)enumerateItems:(void (^)(id))block; 7 | - (void)removeItem:(NSInteger)key; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /submodules/UIKitRuntimeUtils/Source/UIKitRuntimeUtils/NSBag.m: -------------------------------------------------------------------------------- 1 | #import "NSBag.h" 2 | 3 | @interface NSBag () 4 | { 5 | NSInteger _nextKey; 6 | NSMutableArray *_items; 7 | NSMutableArray *_itemKeys; 8 | } 9 | 10 | @end 11 | 12 | @implementation NSBag 13 | 14 | - (instancetype)init 15 | { 16 | self = [super init]; 17 | if (self != nil) 18 | { 19 | _items = [[NSMutableArray alloc] init]; 20 | _itemKeys = [[NSMutableArray alloc] init]; 21 | } 22 | return self; 23 | } 24 | 25 | - (NSInteger)addItem:(id)item 26 | { 27 | if (item == nil) 28 | return -1; 29 | 30 | NSInteger key = _nextKey; 31 | [_items addObject:item]; 32 | [_itemKeys addObject:@(key)]; 33 | _nextKey++; 34 | 35 | return key; 36 | } 37 | 38 | - (void)enumerateItems:(void (^)(id))block 39 | { 40 | if (block) 41 | { 42 | for (id item in _items) 43 | { 44 | block(item); 45 | } 46 | } 47 | } 48 | 49 | - (void)removeItem:(NSInteger)key 50 | { 51 | NSUInteger index = 0; 52 | for (NSNumber *itemKey in _itemKeys) 53 | { 54 | if ([itemKey integerValue] == key) 55 | { 56 | [_items removeObjectAtIndex:index]; 57 | [_itemKeys removeObjectAtIndex:index]; 58 | break; 59 | } 60 | index++; 61 | } 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /submodules/UIKitRuntimeUtils/Source/UIKitRuntimeUtils/NSWeakReference.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSWeakReference : NSObject 4 | 5 | @property (nonatomic, weak) id value; 6 | 7 | - (instancetype)initWithValue:(id)value; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /submodules/UIKitRuntimeUtils/Source/UIKitRuntimeUtils/NSWeakReference.m: -------------------------------------------------------------------------------- 1 | #import "NSWeakReference.h" 2 | 3 | @implementation NSWeakReference 4 | 5 | - (instancetype)initWithValue:(id)value { 6 | self = [super init]; 7 | if (self != nil) { 8 | self.value = value; 9 | } 10 | return self; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /submodules/UIKitRuntimeUtils/Source/UIKitRuntimeUtils/NotificationCenterUtils.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | typedef bool (^NotificationHandlerBlock)(NSString *, id, NSDictionary *, void (^)()); 4 | 5 | @interface NotificationCenterUtils : NSObject 6 | 7 | + (void)addNotificationHandler:(NotificationHandlerBlock)handler; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /submodules/UIKitRuntimeUtils/Source/UIKitRuntimeUtils/UIBarButtonItem+Proxy.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | typedef void (^UIBarButtonItemSetTitleListener)(NSString *); 5 | typedef void (^UIBarButtonItemSetEnabledListener)(BOOL); 6 | 7 | @interface UIBarButtonItem (Proxy) 8 | 9 | @property (nonatomic, strong, readonly) ASDisplayNode *customDisplayNode; 10 | @property (nonatomic, readonly) bool backButtonAppearance; 11 | 12 | - (instancetype)initWithCustomDisplayNode:(ASDisplayNode *)customDisplayNode; 13 | - (instancetype)initWithBackButtonAppearanceWithTitle:(NSString *)title target:(id)target action:(SEL)action; 14 | 15 | - (void)performActionOnTarget; 16 | 17 | - (NSInteger)addSetTitleListener:(UIBarButtonItemSetTitleListener)listener; 18 | - (void)removeSetTitleListener:(NSInteger)key; 19 | - (NSInteger)addSetEnabledListener:(UIBarButtonItemSetEnabledListener)listener; 20 | - (void)removeSetEnabledListener:(NSInteger)key; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /submodules/UIKitRuntimeUtils/Source/UIKitRuntimeUtils/UIKitUtils.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | double animationDurationFactorImpl(); 5 | 6 | CABasicAnimation * _Nonnull makeSpringAnimationImpl(NSString * _Nonnull keyPath); 7 | CABasicAnimation * _Nonnull makeSpringBounceAnimationImpl(NSString * _Nonnull keyPath, CGFloat initialVelocity, CGFloat damping); 8 | CGFloat springAnimationValueAtImpl(CABasicAnimation * _Nonnull animation, CGFloat t); 9 | 10 | UIBlurEffect *makeCustomZoomBlurEffectImpl(); 11 | void applySmoothRoundedCornersImpl(CALayer * _Nonnull layer); 12 | -------------------------------------------------------------------------------- /submodules/UIKitRuntimeUtils/Source/UIKitRuntimeUtils/UIMenuItem+Icons.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface UIMenuItem (Icons) 4 | 5 | - (instancetype)initWithTitle:(NSString *)title icon:(UIImage *)icon action:(SEL)action; 6 | 7 | @end 8 | 9 | -------------------------------------------------------------------------------- /submodules/UIKitRuntimeUtils/Source/UIKitRuntimeUtils/UIWindow+OrientationChange.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface UIWindow (OrientationChange) 4 | 5 | - (bool)isRotating; 6 | + (void)addPostDeviceOrientationDidChangeBlock:(void (^)())block; 7 | + (bool)isDeviceRotating; 8 | 9 | - (void)_updateToInterfaceOrientation:(int)arg1 duration:(double)arg2 force:(BOOL)arg3; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /submodules/UrlEscaping/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "UrlEscaping", 5 | module_name = "UrlEscaping", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | visibility = [ 10 | "//visibility:public", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /submodules/WalletCore/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "WalletCore", 5 | module_name = "WalletCore", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | deps = [ 10 | "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit", 11 | "//submodules/TonBinding:TonBinding", 12 | ], 13 | visibility = [ 14 | "//visibility:public", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/Animations/SendingGrams.tgs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/Animations/SendingGrams.tgs -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/Animations/WalletApologiesAccepted.tgs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/Animations/WalletApologiesAccepted.tgs -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/Animations/WalletCreated.tgs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/Animations/WalletCreated.tgs -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/Animations/WalletDone.tgs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/Animations/WalletDone.tgs -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/Animations/WalletEmpty.tgs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/Animations/WalletEmpty.tgs -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/Animations/WalletInitializing.tgs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/Animations/WalletInitializing.tgs -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/Animations/WalletIntroLoading.tgs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/Animations/WalletIntroLoading.tgs -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/Animations/WalletIntroStatic.tgs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/Animations/WalletIntroStatic.tgs -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/Animations/WalletKeyLock.tgs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/Animations/WalletKeyLock.tgs -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/Animations/WalletNotAvailable.tgs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/Animations/WalletNotAvailable.tgs -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/Animations/WalletSynchronization.tgs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/Animations/WalletSynchronization.tgs -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/Animations/WalletWordCheck.tgs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/Animations/WalletWordCheck.tgs -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/Animations/WalletWordList.tgs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/Animations/WalletWordList.tgs -------------------------------------------------------------------------------- /submodules/WalletUI/Resources/WalletStrings.mapping: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/Resources/WalletStrings.mapping -------------------------------------------------------------------------------- /submodules/WalletUI/Sources/ItemList/ItemListControllerEmptyStateItem.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | import Display 5 | 6 | protocol ItemListControllerEmptyStateItem { 7 | func isEqual(to: ItemListControllerEmptyStateItem) -> Bool 8 | func node(current: ItemListControllerEmptyStateItemNode?) -> ItemListControllerEmptyStateItemNode 9 | } 10 | 11 | class ItemListControllerEmptyStateItemNode: ASDisplayNode { 12 | func updateLayout(layout: ContainerViewLayout, navigationBarHeight: CGFloat, transition: ContainedViewLayoutTransition) { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /submodules/WalletUI/Sources/ItemList/ItemListControllerSearch.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import AsyncDisplayKit 4 | import Display 5 | 6 | protocol ItemListControllerSearchNavigationContentNode { 7 | func activate() 8 | func deactivate() 9 | 10 | func setQueryUpdated(_ f: @escaping (String) -> Void) 11 | } 12 | 13 | protocol ItemListControllerSearch { 14 | func isEqual(to: ItemListControllerSearch) -> Bool 15 | func titleContentNode(current: (NavigationBarContentNode & ItemListControllerSearchNavigationContentNode)?) -> NavigationBarContentNode & ItemListControllerSearchNavigationContentNode 16 | func node(current: ItemListControllerSearchNode?, titleContentNode: (NavigationBarContentNode & ItemListControllerSearchNavigationContentNode)?) -> ItemListControllerSearchNode 17 | } 18 | 19 | class ItemListControllerSearchNode: ASDisplayNode { 20 | func activate() { 21 | self.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2, timingFunction: CAMediaTimingFunctionName.easeInEaseOut.rawValue) 22 | } 23 | 24 | func deactivate() { 25 | self.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, timingFunction: CAMediaTimingFunctionName.easeInEaseOut.rawValue, removeOnCompletion: false, completion: { [weak self] _ in 26 | self?.removeFromSupernode() 27 | }) 28 | } 29 | 30 | func scrollToTop() { 31 | } 32 | 33 | func queryUpdated(_ query: String) { 34 | } 35 | 36 | func updateLayout(layout: ContainerViewLayout, navigationBarHeight: CGFloat, transition: ContainedViewLayoutTransition) { 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /submodules/WalletUI/Sources/WalletBuyGramsScreen.swift: -------------------------------------------------------------------------------- 1 | import class SafariServices.SFSafariViewController 2 | 3 | public final class WalletBuyGramsScreen: SFSafariViewController { 4 | 5 | // MARK: - Override 6 | 7 | public override func viewDidLoad() { 8 | super.viewDidLoad() 9 | if #available(iOS 11.0, *) { 10 | dismissButtonStyle = .cancel 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /submodules/WalletUI/Sources/WalletConfiguration.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct WalletConfiguration { 4 | public static var defaultValue: WalletConfiguration { 5 | return WalletConfiguration(config: nil, blockchainName: nil, disableProxy: false) 6 | } 7 | 8 | public let config: String? 9 | public let blockchainName: String? 10 | public let disableProxy: Bool 11 | 12 | public init(config: String?, blockchainName: String?, disableProxy: Bool) { 13 | self.config = config 14 | self.blockchainName = blockchainName 15 | self.disableProxy = disableProxy 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /submodules/WalletUI/Sources/WalletContext.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import SwiftSignalKit 4 | import Display 5 | import WalletCore 6 | 7 | public enum WalletContextGetServerSaltError { 8 | case generic 9 | } 10 | 11 | public enum WalletDownloadFileError { 12 | case generic 13 | } 14 | 15 | public protocol WalletContext { 16 | var storage: WalletStorageInterface { get } 17 | var tonInstance: TonInstance { get } 18 | var keychain: TonKeychain { get } 19 | var presentationData: WalletPresentationData { get } 20 | 21 | var supportsCustomConfigurations: Bool { get } 22 | var termsUrl: String? { get } 23 | var feeInfoUrl: String? { get } 24 | 25 | var inForeground: Signal { get } 26 | 27 | func getServerSalt() -> Signal 28 | func downloadFile(url: URL) -> Signal 29 | 30 | func updateResolvedWalletConfiguration(configuration: LocalWalletConfiguration, source: LocalWalletConfigurationSource, resolvedConfig: String) -> Signal 31 | 32 | func presentNativeController(_ controller: UIViewController) 33 | 34 | func idleTimerExtension() -> Disposable 35 | func openUrl(_ url: String) 36 | func shareUrl(_ url: String) 37 | func openPlatformSettings() 38 | func authorizeAccessToCamera(completion: @escaping () -> Void) 39 | func pickImage(present: @escaping (ViewController) -> Void, completion: @escaping (UIImage) -> Void) 40 | } 41 | -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/BalanceGem.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "gem.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/BalanceGem.imageset/gem.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/BalanceGem.imageset/gem.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/CameraFlashIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_flash.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/CameraFlashIcon.imageset/ic_flash.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/CameraFlashIcon.imageset/ic_flash.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/CameraGalleryIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_gallery (3).pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/CameraGalleryIcon.imageset/ic_gallery (3).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/CameraGalleryIcon.imageset/ic_gallery (3).pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/ClearInput.imageset/Clear.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/ClearInput.imageset/Clear.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/ClearInput.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Clear.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | }, 6 | "properties" : { 7 | "provides-namespace" : true 8 | } 9 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/DisclosureArrow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_open.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/DisclosureArrow.imageset/ic_open.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/DisclosureArrow.imageset/ic_open.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/DuckIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "duck.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/DuckIcon.imageset/duck.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/DuckIcon.imageset/duck.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/EncryptedComment.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_encrypted.pdf", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/EncryptedComment.imageset/ic_encrypted.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/EncryptedComment.imageset/ic_encrypted.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/NavigationSettingsIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "NavigationSettingsIcon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/NavigationSettingsIcon.imageset/NavigationSettingsIcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/NavigationSettingsIcon.imageset/NavigationSettingsIcon.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/NavigationShare.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_share.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/NavigationShare.imageset/ic_share.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/NavigationShare.imageset/ic_share.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/NavigationShareIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_share.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/NavigationShareIcon.imageset/ic_share.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/NavigationShareIcon.imageset/ic_share.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/QrGem.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "QrGem@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "QrGem@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/QrGem.imageset/QrGem@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/QrGem.imageset/QrGem@2x.png -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/QrGem.imageset/QrGem@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/QrGem.imageset/QrGem@3x.png -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/QrIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_qrcode.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/QrIcon.imageset/ic_qrcode.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/QrIcon.imageset/ic_qrcode.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/ReceiveButtonIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Group2.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/ReceiveButtonIcon.imageset/Group2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/ReceiveButtonIcon.imageset/Group2.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/RefreshIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_walletupdate.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/RefreshIcon.imageset/ic_walletupdate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/RefreshIcon.imageset/ic_walletupdate.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/SendButtonIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Group.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/SendButtonIcon.imageset/Group.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/SendButtonIcon.imageset/Group.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/SplashCornerL.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "TopLeft.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/SplashCornerL.imageset/TopLeft.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/SplashCornerL.imageset/TopLeft.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/SplashCornerR.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "TopRight.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/SplashCornerR.imageset/TopRight.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/SplashCornerR.imageset/TopRight.pdf -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/TransactionGem.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SmallGem.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /submodules/WalletUI/WalletImages.xcassets/Wallet/TransactionGem.imageset/SmallGem.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/WalletUI/WalletImages.xcassets/Wallet/TransactionGem.imageset/SmallGem.pdf -------------------------------------------------------------------------------- /submodules/WalletUrl/BUILD: -------------------------------------------------------------------------------- 1 | load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") 2 | 3 | swift_library( 4 | name = "WalletUrl", 5 | module_name = "WalletUrl", 6 | srcs = glob([ 7 | "Sources/**/*.swift", 8 | ]), 9 | visibility = [ 10 | "//visibility:public", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /submodules/YuvConversion/BUILD: -------------------------------------------------------------------------------- 1 | 2 | objc_library( 3 | name = "YuvConversion", 4 | enable_modules = True, 5 | module_name = "YuvConversion", 6 | srcs = glob([ 7 | "Sources/*.m", 8 | ]), 9 | hdrs = glob([ 10 | "PublicHeaders/**/*.h", 11 | ]), 12 | includes = [ 13 | "PublicHeaders", 14 | ], 15 | sdk_frameworks = [ 16 | "Foundation", 17 | ], 18 | visibility = [ 19 | "//visibility:public", 20 | ], 21 | ) 22 | -------------------------------------------------------------------------------- /submodules/YuvConversion/PublicHeaders/YuvConversion/YUV.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | void encodeRGBAToYUVA(uint8_t *yuva, uint8_t const *argb, int width, int height, int bytesPerRow); 4 | void decodeYUVAToRGBA(uint8_t const *yuva, uint8_t *argb, int width, int height, int bytesPerRow); 5 | -------------------------------------------------------------------------------- /submodules/openssl/openssl-1.1.1d.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/openssl/openssl-1.1.1d.tar.gz -------------------------------------------------------------------------------- /submodules/openssl/patch-conf.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf 2 | --- a/Configurations/10-main.conf 3 | +++ b/Configurations/10-main.conf 4 | @@ -1640,6 +1640,13 @@ my %targets = ( 5 | sys_id => "VXWORKS", 6 | lflags => add("-r"), 7 | }, 8 | + "ios64sim-cross" => { 9 | + inherit_from => [ "darwin-common", asm("no_asm") ], 10 | + cflags => add("-arch x86_64 -DOPENSSL_NO_ASM -mios-version-min=8.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"), 11 | + sys_id => "iOS", 12 | + bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", 13 | + perlasm_scheme => "ios64", 14 | + }, 15 | "vxworks-simlinux" => { 16 | inherit_from => [ "BASE_unix" ], 17 | CC => "ccpentium", 18 | -------------------------------------------------------------------------------- /submodules/openssl/patch-include.patch: -------------------------------------------------------------------------------- 1 | --- opensslconf.h 2020-01-06 02:41:46.000000000 +0400 2 | +++ opensslconf_updated.h 2020-01-06 02:51:12.000000000 +0400 3 | @@ -205,11 +205,21 @@ 4 | * The following are cipher-specific, but are part of the public API. 5 | */ 6 | #if !defined(OPENSSL_SYS_UEFI) 7 | -# undef BN_LLONG 8 | +# ifdef __LP64__ 9 | +# undef BN_LLONG 10 | +# else 11 | +# define BN_LLONG 12 | +# endif 13 | /* Only one for the following should be defined */ 14 | -# define SIXTY_FOUR_BIT_LONG 15 | -# undef SIXTY_FOUR_BIT 16 | -# undef THIRTY_TWO_BIT 17 | +# ifdef __LP64__ 18 | +# define SIXTY_FOUR_BIT_LONG 19 | +# undef SIXTY_FOUR_BIT 20 | +# undef THIRTY_TWO_BIT 21 | +# else 22 | +# undef SIXTY_FOUR_BIT_LONG 23 | +# undef SIXTY_FOUR_BIT 24 | +# define THIRTY_TWO_BIT 25 | +# endif 26 | #endif 27 | 28 | #define RC4_INT unsigned char 29 | -------------------------------------------------------------------------------- /submodules/rlottie/BUILD: -------------------------------------------------------------------------------- 1 | 2 | objc_library( 3 | name = "RLottieBinding", 4 | module_name = "RLottieBinding", 5 | enable_modules = True, 6 | srcs = glob([ 7 | "rlottie/src/**/*.cpp", 8 | "rlottie/src/**/*.h", 9 | "rlottie/inc/**/*.h", 10 | ], exclude = [ 11 | "rlottie/src/vector/vdrawhelper_neon.cpp", 12 | "rlottie/src/vector/stb/**/*", 13 | "rlottie/src/lottie/rapidjson/msinttypes/**/*", 14 | ]) + [ 15 | "LottieInstance.mm", 16 | "config.h", 17 | ], 18 | hdrs = glob([ 19 | "PublicHeaders/**/*.h", 20 | ]), 21 | includes = [ 22 | "PublicHeaders", 23 | ], 24 | copts = [ 25 | "-Dpixman_region_selfcheck(x)=1", 26 | "-DLOTTIE_DISABLE_ARM_NEON=1", 27 | "-DLOTTIE_IMAGE_MODULE_DISABLED=1", 28 | "-I{}".format(package_name()), 29 | "-I{}/rlottie/inc".format(package_name()), 30 | "-I{}/rlottie/src/vector".format(package_name()), 31 | "-I{}/rlottie/src/vector/pixman".format(package_name()), 32 | "-I{}/rlottie/src/vector/freetype".format(package_name()), 33 | ], 34 | deps = [ 35 | ], 36 | visibility = ["//visibility:public"], 37 | ) 38 | -------------------------------------------------------------------------------- /submodules/rlottie/LottieInstance.mm: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #include "rlottie.h" 4 | 5 | @interface LottieInstance () { 6 | std::unique_ptr _animation; 7 | } 8 | 9 | @end 10 | 11 | @implementation LottieInstance 12 | 13 | - (instancetype _Nullable)initWithData:(NSData * _Nonnull)data cacheKey:(NSString * _Nonnull)cacheKey { 14 | self = [super init]; 15 | if (self != nil) { 16 | _animation = rlottie::Animation::loadFromData(std::string(reinterpret_cast(data.bytes), data.length), std::string([cacheKey UTF8String])); 17 | if (_animation == nullptr) { 18 | return nil; 19 | } 20 | 21 | _frameCount = (int32_t)_animation->totalFrame(); 22 | _frameRate = (int32_t)_animation->frameRate(); 23 | 24 | size_t width = 0; 25 | size_t height = 0; 26 | _animation->size(width, height); 27 | 28 | if (width > 1024 || height > 1024) { 29 | return nil; 30 | } 31 | 32 | _dimensions = CGSizeMake(width, height); 33 | 34 | if ((_frameRate > 60) || _animation->duration() > 7.0) { 35 | return nil; 36 | } 37 | } 38 | return self; 39 | } 40 | 41 | - (void)renderFrameWithIndex:(int32_t)index into:(uint8_t * _Nonnull)buffer width:(int32_t)width height:(int32_t)height bytesPerRow:(int32_t) bytesPerRow{ 42 | rlottie::Surface surface((uint32_t *)buffer, width, height, bytesPerRow); 43 | _animation->renderSync(index, surface); 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /submodules/rlottie/PublicHeaders/RLottieBinding/LottieInstance.h: -------------------------------------------------------------------------------- 1 | #ifndef Lottie_h 2 | #define Lottie_h 3 | 4 | #import 5 | #import 6 | 7 | @interface LottieInstance : NSObject 8 | 9 | @property (nonatomic, readonly) int32_t frameCount; 10 | @property (nonatomic, readonly) int32_t frameRate; 11 | @property (nonatomic, readonly) CGSize dimensions; 12 | 13 | - (instancetype _Nullable)initWithData:(NSData * _Nonnull)data cacheKey:(NSString * _Nonnull)cacheKey; 14 | - (void)renderFrameWithIndex:(int32_t)index into:(uint8_t * _Nonnull)buffer width:(int32_t)width height:(int32_t)height bytesPerRow:(int32_t)bytesPerRow; 15 | 16 | @end 17 | 18 | #endif /* Lottie_h */ 19 | -------------------------------------------------------------------------------- /submodules/rlottie/config.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_H 2 | #define CONFIG_H 3 | 4 | // enable threading 5 | //#define LOTTIE_THREAD_SUPPORT 6 | 7 | #define LOTTIE_THREAD_SAFE 8 | 9 | //enable logging 10 | //#define LOTTIE_LOGGING_SUPPORT 11 | 12 | //enable module building of image loader 13 | //#define LOTTIE_IMAGE_MODULE_SUPPORT 14 | 15 | //enable lottie model caching 16 | //#define LOTTIE_CACHE_SUPPORT 17 | 18 | // disable image loader 19 | #define LOTTIE_IMAGE_MODULE_DISABLED 20 | 21 | #endif // CONFIG_H 22 | -------------------------------------------------------------------------------- /submodules/rlottie/rlottie/src/lottie/lottieloader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef LOTTIELOADER_H 20 | #define LOTTIELOADER_H 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | class LOTModel; 27 | class LottieLoader 28 | { 29 | public: 30 | static void configureModelCacheSize(size_t cacheSize); 31 | bool load(const std::string &filePath, bool cachePolicy); 32 | bool loadFromData(std::string &&jsonData, const std::string &key, 33 | const std::string &resourcePath, bool cachePolicy, 34 | const std::vector> 35 | &colorReplacements); 36 | std::shared_ptr model(); 37 | private: 38 | std::shared_ptr mModel; 39 | }; 40 | 41 | #endif // LOTTIELOADER_H 42 | 43 | 44 | -------------------------------------------------------------------------------- /submodules/rlottie/rlottie/src/lottie/lottieparser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef LOTTIEPARSER_H 20 | #define LOTTIEPARSER_H 21 | 22 | #include "lottiemodel.h" 23 | #include 24 | 25 | class LottieParserImpl; 26 | class LottieParser { 27 | public: 28 | ~LottieParser(); 29 | LottieParser(char *str, const char *dir_path, 30 | const std::vector> 31 | &colorReplacements = {}); 32 | std::shared_ptr model(); 33 | private: 34 | std::unique_ptr d; 35 | }; 36 | 37 | #endif // LOTTIEPARSER_H 38 | -------------------------------------------------------------------------------- /submodules/rlottie/rlottie/src/lottie/lottieproxymodel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/submodules/rlottie/rlottie/src/lottie/lottieproxymodel.cpp -------------------------------------------------------------------------------- /submodules/rlottie/rlottie/src/lottie/rapidjson/internal/swap.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_SWAP_H_ 16 | #define RAPIDJSON_INTERNAL_SWAP_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(__clang__) 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(c++98-compat) 23 | #endif 24 | 25 | RAPIDJSON_NAMESPACE_BEGIN 26 | namespace internal { 27 | 28 | //! Custom swap() to avoid dependency on C++ header 29 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. 30 | \note This has the same semantics as std::swap(). 31 | */ 32 | template 33 | inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT { 34 | T tmp = a; 35 | a = b; 36 | b = tmp; 37 | } 38 | 39 | } // namespace internal 40 | RAPIDJSON_NAMESPACE_END 41 | 42 | #if defined(__clang__) 43 | RAPIDJSON_DIAG_POP 44 | #endif 45 | 46 | #endif // RAPIDJSON_INTERNAL_SWAP_H_ 47 | -------------------------------------------------------------------------------- /submodules/rlottie/rlottie/src/vector/velapsedtimer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include "velapsedtimer.h" 20 | 21 | void VElapsedTimer::start() 22 | { 23 | clock = std::chrono::high_resolution_clock::now(); 24 | m_valid = true; 25 | } 26 | 27 | double VElapsedTimer::restart() 28 | { 29 | double elapsedTime = elapsed(); 30 | start(); 31 | return elapsedTime; 32 | } 33 | 34 | double VElapsedTimer::elapsed() const 35 | { 36 | if (!isValid()) return 0; 37 | return std::chrono::duration( 38 | std::chrono::high_resolution_clock::now() - clock) 39 | .count(); 40 | } 41 | 42 | bool VElapsedTimer::hasExpired(double time) 43 | { 44 | double elapsedTime = elapsed(); 45 | if (elapsedTime > time) return true; 46 | return false; 47 | } 48 | -------------------------------------------------------------------------------- /submodules/rlottie/rlottie/src/vector/velapsedtimer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef VELAPSEDTIMER_H 20 | #define VELAPSEDTIMER_H 21 | 22 | #include 23 | #include "vglobal.h" 24 | 25 | class VElapsedTimer { 26 | public: 27 | double elapsed() const; 28 | bool hasExpired(double millsec); 29 | void start(); 30 | double restart(); 31 | inline bool isValid() const { return m_valid; } 32 | 33 | private: 34 | std::chrono::high_resolution_clock::time_point clock; 35 | bool m_valid{false}; 36 | }; 37 | #endif // VELAPSEDTIMER_H 38 | -------------------------------------------------------------------------------- /submodules/rlottie/rlottie/src/vector/vimageloader.h: -------------------------------------------------------------------------------- 1 | #ifndef VIMAGELOADER_H 2 | #define VIMAGELOADER_H 3 | 4 | #include 5 | 6 | #include "vbitmap.h" 7 | 8 | class VImageLoader 9 | { 10 | public: 11 | static VImageLoader& instance() 12 | { 13 | static VImageLoader singleton; 14 | return singleton; 15 | } 16 | 17 | VBitmap load(const char *fileName); 18 | VBitmap load(const char *data, size_t len); 19 | ~VImageLoader(); 20 | private: 21 | VImageLoader(); 22 | struct Impl; 23 | std::unique_ptr mImpl; 24 | }; 25 | 26 | #endif // VIMAGELOADER_H 27 | -------------------------------------------------------------------------------- /submodules/rlottie/rlottie/src/vector/vpathmesure.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef VPATHMESURE_H 20 | #define VPATHMESURE_H 21 | 22 | #include "vpath.h" 23 | 24 | V_BEGIN_NAMESPACE 25 | 26 | class VPathMesure { 27 | public: 28 | void setStart(float start){mStart = start;} 29 | void setEnd(float end){mEnd = end;} 30 | VPath trim(const VPath &path); 31 | private: 32 | float mStart{0.0f}; 33 | float mEnd{1.0f}; 34 | }; 35 | 36 | V_END_NAMESPACE 37 | 38 | #endif // VPATHMESURE_H 39 | -------------------------------------------------------------------------------- /submodules/rlottie/rlottie/src/vector/vraster.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef VRASTER_H 20 | #define VRASTER_H 21 | #include 22 | #include "vglobal.h" 23 | #include "vrect.h" 24 | 25 | V_BEGIN_NAMESPACE 26 | 27 | class VPath; 28 | class VRle; 29 | 30 | class VRasterizer 31 | { 32 | public: 33 | void rasterize(VPath path, FillRule fillRule = FillRule::Winding, const VRect &clip = VRect()); 34 | void rasterize(VPath path, CapStyle cap, JoinStyle join, float width, 35 | float miterLimit, const VRect &clip = VRect()); 36 | VRle rle(); 37 | private: 38 | struct VRasterizerImpl; 39 | void init(); 40 | void updateRequest(); 41 | std::shared_ptr d{nullptr}; 42 | }; 43 | 44 | V_END_NAMESPACE 45 | 46 | #endif // VRASTER_H 47 | -------------------------------------------------------------------------------- /submodules/ton/Apple-bazel.cmake: -------------------------------------------------------------------------------- 1 | add_definitions (-DTARGET_CPU_X86_64) 2 | add_definitions (-DTARGET_OS_OSX) 3 | -------------------------------------------------------------------------------- /third-party/cmake/BUILD: -------------------------------------------------------------------------------- 1 | 2 | genrule( 3 | name = "cmake", 4 | srcs = [ 5 | "cmake-3.16.0.tar.gz", 6 | ], 7 | cmd_bash = 8 | """ 9 | BUILD_DIR="$(RULEDIR)/build" 10 | rm -rf "$$BUILD_DIR" 11 | mkdir -p "$$BUILD_DIR" 12 | tar -xzf "$(location cmake-3.16.0.tar.gz)" --directory "$$BUILD_DIR" 13 | 14 | pushd "$$BUILD_DIR/cmake-3.16.0" 15 | 16 | export PATH=/usr/bin:/bin:/usr/sbin:/sbin 17 | 18 | core_count="`sysctl -n hw.logicalcpu`" 19 | ./bootstrap --parallel=$$core_count -- -DCMAKE_BUILD_TYPE:STRING=Release 20 | make -j $$core_count 21 | 22 | popd 23 | 24 | tar -cf "$(location cmake.tar)" -C "$$BUILD_DIR/cmake-3.16.0" . 25 | """, 26 | outs = [ 27 | "cmake.tar", 28 | ], 29 | visibility = [ 30 | "//visibility:public", 31 | ] 32 | ) 33 | -------------------------------------------------------------------------------- /third-party/cmake/cmake-3.16.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ton-blockchain/wallet-ios/ea3f6654d4a70d00d9f2d07fe9362ecd23d4093b/third-party/cmake/cmake-3.16.0.tar.gz --------------------------------------------------------------------------------