@triniwiz/nativescript-masonkit 1.0.0-alpha.4 → 1.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common.d.ts +7 -9
- package/common.js +277 -552
- package/common.js.map +1 -1
- package/helpers.d.ts +32 -10
- package/helpers.js +772 -286
- package/helpers.js.map +1 -1
- package/index.android.d.ts +6 -2
- package/index.android.js +21 -3
- package/index.android.js.map +1 -1
- package/index.d.ts +64 -7
- package/index.ios.d.ts +9 -6
- package/index.ios.js +39 -25
- package/index.ios.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/include.gradle +18 -1
- package/platforms/android/masonkit-release.aar +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +108 -64
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +47 -20
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Info.plist +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +6692 -794
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +58 -21
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +58 -21
- package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +216 -128
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +47 -20
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Info.plist +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +6692 -794
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +58 -21
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +58 -21
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +6692 -794
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +58 -21
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +58 -21
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +43 -43
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/build.xcconfig +1 -2
- package/platforms/ios/src/MasonV8Module.h +583 -0
- package/platforms/ios/src/MasonV8Module.mm +1005 -0
- package/platforms/ios/src/{include → cpp/include}/mason_native.h +47 -20
- package/platforms/ios/src/cpp/include/robin_hood.h +2544 -0
- package/platforms/ios/src/module.modulemap +2 -2
- package/platforms/new_native_src/cpp/Caches.cpp +36 -0
- package/platforms/new_native_src/cpp/Caches.h +42 -0
- package/platforms/new_native_src/cpp/Common.h +34 -0
- package/platforms/new_native_src/cpp/ConcurrentMap.h +57 -0
- package/platforms/new_native_src/cpp/Helpers.cpp +101 -0
- package/platforms/new_native_src/cpp/Helpers.h +364 -0
- package/platforms/new_native_src/cpp/MasonImpl.cpp +68 -0
- package/platforms/new_native_src/cpp/MasonImpl.h +40 -0
- package/platforms/new_native_src/cpp/MasonNodeImpl.cpp +89 -0
- package/platforms/new_native_src/cpp/MasonNodeImpl.h +47 -0
- package/platforms/new_native_src/cpp/MasonStyleImpl.cpp +2181 -0
- package/platforms/new_native_src/cpp/MasonStyleImpl.h +420 -0
- package/platforms/{ios/Mason.xcframework/ios-arm64/Mason.framework/PrivateHeaders → new_native_src/cpp/include}/mason_native.h +464 -168
- package/platforms/new_native_src/cpp/include/robin_hood.h +2544 -0
- package/pods/Headers/include/APIDesign.md +72 -0
- package/pods/Headers/include/DEPS +10 -0
- package/pods/Headers/include/DIR_METADATA +11 -0
- package/pods/Headers/include/OWNERS +23 -0
- package/pods/Headers/include/cppgc/DEPS +8 -0
- package/pods/Headers/include/cppgc/OWNERS +2 -0
- package/pods/Headers/include/cppgc/README.md +133 -0
- package/pods/Headers/include/cppgc/allocation.h +310 -0
- package/pods/Headers/include/cppgc/common.h +29 -0
- package/pods/Headers/include/cppgc/cross-thread-persistent.h +465 -0
- package/pods/Headers/include/cppgc/custom-space.h +97 -0
- package/pods/Headers/include/cppgc/default-platform.h +67 -0
- package/pods/Headers/include/cppgc/ephemeron-pair.h +30 -0
- package/pods/Headers/include/cppgc/explicit-management.h +100 -0
- package/pods/Headers/include/cppgc/garbage-collected.h +106 -0
- package/pods/Headers/include/cppgc/heap-consistency.h +266 -0
- package/pods/Headers/include/cppgc/heap-state.h +82 -0
- package/pods/Headers/include/cppgc/heap-statistics.h +120 -0
- package/pods/Headers/include/cppgc/heap.h +206 -0
- package/pods/Headers/include/cppgc/internal/api-constants.h +55 -0
- package/pods/Headers/include/cppgc/internal/atomic-entry-flag.h +48 -0
- package/pods/Headers/include/cppgc/internal/caged-heap-local-data.h +79 -0
- package/pods/Headers/include/cppgc/internal/compiler-specific.h +38 -0
- package/pods/Headers/include/cppgc/internal/finalizer-trait.h +93 -0
- package/pods/Headers/include/cppgc/internal/gc-info.h +156 -0
- package/pods/Headers/include/cppgc/internal/logging.h +50 -0
- package/pods/Headers/include/cppgc/internal/name-trait.h +122 -0
- package/pods/Headers/include/cppgc/internal/persistent-node.h +216 -0
- package/pods/Headers/include/cppgc/internal/pointer-policies.h +186 -0
- package/pods/Headers/include/cppgc/internal/write-barrier.h +435 -0
- package/pods/Headers/include/cppgc/liveness-broker.h +77 -0
- package/pods/Headers/include/cppgc/macros.h +26 -0
- package/pods/Headers/include/cppgc/member.h +291 -0
- package/pods/Headers/include/cppgc/name-provider.h +65 -0
- package/pods/Headers/include/cppgc/object-size-trait.h +58 -0
- package/pods/Headers/include/cppgc/persistent.h +370 -0
- package/pods/Headers/include/cppgc/platform.h +156 -0
- package/pods/Headers/include/cppgc/prefinalizer.h +75 -0
- package/pods/Headers/include/cppgc/process-heap-statistics.h +36 -0
- package/pods/Headers/include/cppgc/sentinel-pointer.h +32 -0
- package/pods/Headers/include/cppgc/source-location.h +92 -0
- package/pods/Headers/include/cppgc/testing.h +106 -0
- package/pods/Headers/include/cppgc/trace-trait.h +116 -0
- package/pods/Headers/include/cppgc/type-traits.h +240 -0
- package/pods/Headers/include/cppgc/visitor.h +379 -0
- package/pods/Headers/include/js_protocol-1.2.json +936 -0
- package/pods/Headers/include/js_protocol-1.3.json +1112 -0
- package/pods/Headers/include/js_protocol.pdl +1709 -0
- package/pods/Headers/include/libffi/arm64/ffi.h +524 -0
- package/pods/Headers/include/libffi/arm64/ffitarget.h +92 -0
- package/pods/Headers/include/libffi/x86_64/ffi.h +524 -0
- package/pods/Headers/include/libffi/x86_64/ffitarget.h +147 -0
- package/pods/Headers/include/libffi.h +12 -0
- package/pods/Headers/include/libplatform/DEPS +9 -0
- package/pods/Headers/include/libplatform/libplatform-export.h +29 -0
- package/pods/Headers/include/libplatform/libplatform.h +106 -0
- package/pods/Headers/include/libplatform/v8-tracing.h +333 -0
- package/pods/Headers/include/v8-array-buffer.h +433 -0
- package/pods/Headers/include/v8-callbacks.h +397 -0
- package/pods/Headers/include/v8-container.h +129 -0
- package/pods/Headers/include/v8-context.h +407 -0
- package/pods/Headers/include/v8-cppgc.h +215 -0
- package/pods/Headers/include/v8-data.h +80 -0
- package/pods/Headers/include/v8-date.h +43 -0
- package/pods/Headers/include/v8-debug.h +168 -0
- package/pods/Headers/include/v8-embedder-heap.h +218 -0
- package/pods/Headers/include/v8-embedder-state-scope.h +51 -0
- package/pods/Headers/include/v8-exception.h +217 -0
- package/pods/Headers/include/v8-extension.h +62 -0
- package/pods/Headers/include/v8-external.h +37 -0
- package/pods/Headers/include/v8-fast-api-calls.h +939 -0
- package/pods/Headers/include/v8-forward.h +81 -0
- package/pods/Headers/include/v8-function-callback.h +475 -0
- package/pods/Headers/include/v8-function.h +125 -0
- package/pods/Headers/include/v8-initialization.h +315 -0
- package/pods/Headers/include/v8-inspector-protocol.h +13 -0
- package/pods/Headers/include/v8-inspector.h +376 -0
- package/pods/Headers/include/v8-internal.h +661 -0
- package/pods/Headers/include/v8-isolate.h +1709 -0
- package/pods/Headers/include/v8-json.h +47 -0
- package/pods/Headers/include/v8-local-handle.h +455 -0
- package/pods/Headers/include/v8-locker.h +149 -0
- package/pods/Headers/include/v8-maybe.h +137 -0
- package/pods/Headers/include/v8-memory-span.h +43 -0
- package/pods/Headers/include/v8-message.h +216 -0
- package/pods/Headers/include/v8-metrics.h +255 -0
- package/pods/Headers/include/v8-microtask-queue.h +152 -0
- package/pods/Headers/include/v8-microtask.h +28 -0
- package/pods/Headers/include/v8-object.h +775 -0
- package/pods/Headers/include/v8-persistent-handle.h +590 -0
- package/pods/Headers/include/v8-platform.h +1092 -0
- package/pods/Headers/include/v8-primitive-object.h +118 -0
- package/pods/Headers/include/v8-primitive.h +866 -0
- package/pods/Headers/include/v8-profiler.h +1198 -0
- package/pods/Headers/include/v8-promise.h +174 -0
- package/pods/Headers/include/v8-proxy.h +50 -0
- package/pods/Headers/include/v8-regexp.h +105 -0
- package/pods/Headers/include/v8-script.h +748 -0
- package/pods/Headers/include/v8-snapshot.h +196 -0
- package/pods/Headers/include/v8-statistics.h +217 -0
- package/pods/Headers/include/v8-template.h +1079 -0
- package/pods/Headers/include/v8-traced-handle.h +420 -0
- package/pods/Headers/include/v8-typed-array.h +282 -0
- package/pods/Headers/include/v8-unwinder-state.h +31 -0
- package/pods/Headers/include/v8-unwinder.h +132 -0
- package/pods/Headers/include/v8-util.h +658 -0
- package/pods/Headers/include/v8-value-serializer-version.h +24 -0
- package/pods/Headers/include/v8-value-serializer.h +279 -0
- package/pods/Headers/include/v8-value.h +526 -0
- package/pods/Headers/include/v8-version-string.h +38 -0
- package/pods/Headers/include/v8-version.h +20 -0
- package/pods/Headers/include/v8-wasm-trap-handler-posix.h +31 -0
- package/pods/Headers/include/v8-wasm-trap-handler-win.h +28 -0
- package/pods/Headers/include/v8-wasm.h +257 -0
- package/pods/Headers/include/v8-weak-callback-info.h +86 -0
- package/pods/Headers/include/v8.h +88 -0
- package/pods/Headers/include/v8config.h +605 -0
- package/pods/Headers/inspector/InspectorServer.h +20 -0
- package/pods/Headers/inspector/JsV8InspectorClient.h +66 -0
- package/pods/Headers/inspector/base/trace_event/common/trace_event_common.h +1123 -0
- package/pods/Headers/inspector/base64.h +9 -0
- package/pods/Headers/inspector/src/base/address-region.h +95 -0
- package/pods/Headers/inspector/src/base/atomic-utils.h +219 -0
- package/pods/Headers/inspector/src/base/atomicops.h +332 -0
- package/pods/Headers/inspector/src/base/atomicops_internals_atomicword_compat.h +89 -0
- package/pods/Headers/inspector/src/base/base-export.h +31 -0
- package/pods/Headers/inspector/src/base/bits.h +343 -0
- package/pods/Headers/inspector/src/base/build_config.h +234 -0
- package/pods/Headers/inspector/src/base/compiler-specific.h +136 -0
- package/pods/Headers/inspector/src/base/export-template.h +163 -0
- package/pods/Headers/inspector/src/base/flags.h +130 -0
- package/pods/Headers/inspector/src/base/immediate-crash.h +162 -0
- package/pods/Headers/inspector/src/base/lazy-instance.h +258 -0
- package/pods/Headers/inspector/src/base/logging.h +417 -0
- package/pods/Headers/inspector/src/base/macros.h +423 -0
- package/pods/Headers/inspector/src/base/memory.h +89 -0
- package/pods/Headers/inspector/src/base/once.h +108 -0
- package/pods/Headers/inspector/src/base/optional.h +882 -0
- package/pods/Headers/inspector/src/base/platform/mutex.h +370 -0
- package/pods/Headers/inspector/src/base/platform/platform.h +476 -0
- package/pods/Headers/inspector/src/base/platform/semaphore.h +108 -0
- package/pods/Headers/inspector/src/base/platform/v8-time.h +513 -0
- package/pods/Headers/inspector/src/base/platform/wrappers.h +73 -0
- package/pods/Headers/inspector/src/base/safe_conversions.h +389 -0
- package/pods/Headers/inspector/src/base/safe_conversions_impl.h +822 -0
- package/pods/Headers/inspector/src/base/template-utils.h +113 -0
- package/pods/Headers/inspector/src/base/v8-fallthrough.h +21 -0
- package/pods/Headers/inspector/src/common/checks.h +38 -0
- package/pods/Headers/inspector/src/common/globals.h +1842 -0
- package/pods/Headers/inspector/src/debug/debug-interface.h +667 -0
- package/pods/Headers/inspector/src/debug/interface-types.h +175 -0
- package/pods/Headers/inspector/src/init/v8.h +52 -0
- package/pods/Headers/inspector/src/inspector/custom-preview.h +24 -0
- package/pods/Headers/inspector/src/inspector/injected-script.h +251 -0
- package/pods/Headers/inspector/src/inspector/inspected-context.h +79 -0
- package/pods/Headers/inspector/src/inspector/protocol/CSS.h +2148 -0
- package/pods/Headers/inspector/src/inspector/protocol/Console.h +211 -0
- package/pods/Headers/inspector/src/inspector/protocol/DOM.h +1008 -0
- package/pods/Headers/inspector/src/inspector/protocol/Debugger.h +892 -0
- package/pods/Headers/inspector/src/inspector/protocol/Forward.h +75 -0
- package/pods/Headers/inspector/src/inspector/protocol/HeapProfiler.h +346 -0
- package/pods/Headers/inspector/src/inspector/protocol/Log.h +342 -0
- package/pods/Headers/inspector/src/inspector/protocol/Network.h +2528 -0
- package/pods/Headers/inspector/src/inspector/protocol/Overlay.h +281 -0
- package/pods/Headers/inspector/src/inspector/protocol/Page.h +1189 -0
- package/pods/Headers/inspector/src/inspector/protocol/Profiler.h +1001 -0
- package/pods/Headers/inspector/src/inspector/protocol/Protocol.h +617 -0
- package/pods/Headers/inspector/src/inspector/protocol/Runtime.h +1696 -0
- package/pods/Headers/inspector/src/inspector/protocol/Schema.h +146 -0
- package/pods/Headers/inspector/src/inspector/protocol/Security.h +793 -0
- package/pods/Headers/inspector/src/inspector/remote-object-id.h +54 -0
- package/pods/Headers/inspector/src/inspector/search-util.h +26 -0
- package/pods/Headers/inspector/src/inspector/string-16.h +180 -0
- package/pods/Headers/inspector/src/inspector/string-util.h +128 -0
- package/pods/Headers/inspector/src/inspector/v8-console-agent-impl.h +48 -0
- package/pods/Headers/inspector/src/inspector/v8-console-message.h +147 -0
- package/pods/Headers/inspector/src/inspector/v8-console.h +173 -0
- package/pods/Headers/inspector/src/inspector/v8-css-agent-impl.h +62 -0
- package/pods/Headers/inspector/src/inspector/v8-debugger-agent-impl.h +248 -0
- package/pods/Headers/inspector/src/inspector/v8-debugger-id.h +44 -0
- package/pods/Headers/inspector/src/inspector/v8-debugger-script.h +123 -0
- package/pods/Headers/inspector/src/inspector/v8-debugger.h +257 -0
- package/pods/Headers/inspector/src/inspector/v8-dom-agent-impl.h +91 -0
- package/pods/Headers/inspector/src/inspector/v8-heap-profiler-agent-impl.h +80 -0
- package/pods/Headers/inspector/src/inspector/v8-inspector-impl.h +191 -0
- package/pods/Headers/inspector/src/inspector/v8-inspector-session-impl.h +156 -0
- package/pods/Headers/inspector/src/inspector/v8-log-agent-impl.h +34 -0
- package/pods/Headers/inspector/src/inspector/v8-network-agent-impl.h +71 -0
- package/pods/Headers/inspector/src/inspector/v8-ns-debugger-agent-impl.h +24 -0
- package/pods/Headers/inspector/src/inspector/v8-overlay-agent-impl.h +70 -0
- package/pods/Headers/inspector/src/inspector/v8-page-agent-impl.h +88 -0
- package/pods/Headers/inspector/src/inspector/v8-profiler-agent-impl.h +104 -0
- package/pods/Headers/inspector/src/inspector/v8-regex.h +38 -0
- package/pods/Headers/inspector/src/inspector/v8-runtime-agent-impl.h +157 -0
- package/pods/Headers/inspector/src/inspector/v8-schema-agent-impl.h +38 -0
- package/pods/Headers/inspector/src/inspector/v8-stack-trace-impl.h +164 -0
- package/pods/Headers/inspector/src/inspector/v8-string-conversions.h +17 -0
- package/pods/Headers/inspector/src/inspector/v8-value-utils.h +23 -0
- package/pods/Headers/inspector/src/inspector/value-mirror.h +87 -0
- package/pods/Headers/inspector/src/libplatform/default-platform.h +92 -0
- package/pods/Headers/inspector/src/logging/tracing-flags.h +50 -0
- package/pods/Headers/inspector/src/numbers/conversions.h +183 -0
- package/pods/Headers/inspector/src/tracing/trace-event.h +664 -0
- package/pods/Headers/inspector/src/utils/allocation.h +367 -0
- package/pods/Headers/inspector/src/utils/vector.h +324 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/cbor.h +305 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/dispatch.h +314 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/error_support.h +62 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/export.h +6 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/find_by_first.h +58 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/frontend_channel.h +47 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/glue.h +80 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json.h +52 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json_platform.h +26 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/maybe.h +104 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/parser_handler.h +39 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/protocol_core.h +406 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializable.h +32 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializer_traits.h +158 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/span.h +99 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/status.h +139 -0
- package/pods/Headers/inspector/utils.h +32 -0
- package/pods/Headers/inspector/v8-inspector-platform.h +44 -0
- package/pods/Headers/jsi/decorator.h +762 -0
- package/pods/Headers/jsi/instrumentation.h +117 -0
- package/pods/Headers/jsi/jsi-inl.h +322 -0
- package/pods/Headers/jsi/jsi.h +1387 -0
- package/pods/Headers/jsi/jsilib.h +59 -0
- package/pods/Headers/jsi/threadsafe.h +79 -0
- package/pods/Headers/runtime/ArgConverter.h +61 -0
- package/pods/Headers/runtime/ArrayAdapter.h +13 -0
- package/pods/Headers/runtime/Caches.h +98 -0
- package/pods/Headers/runtime/ClassBuilder.h +61 -0
- package/pods/Headers/runtime/Common.h +9 -0
- package/pods/Headers/runtime/ConcurrentMap.h +55 -0
- package/pods/Headers/runtime/ConcurrentQueue.h +28 -0
- package/pods/Headers/runtime/Console.h +27 -0
- package/pods/Headers/runtime/Constants.h +15 -0
- package/pods/Headers/runtime/DataWrapper.h +671 -0
- package/pods/Headers/runtime/DictionaryAdapter.h +13 -0
- package/pods/Headers/runtime/ExtVector.h +21 -0
- package/pods/Headers/runtime/FFICall.h +105 -0
- package/pods/Headers/runtime/FastEnumerationAdapter.h +13 -0
- package/pods/Headers/runtime/FunctionReference.h +18 -0
- package/pods/Headers/runtime/Helpers.h +84 -0
- package/pods/Headers/runtime/InlineFunctions.h +16 -0
- package/pods/Headers/runtime/Interop.h +202 -0
- package/pods/Headers/runtime/KnownUnknownClassPair.h +35 -0
- package/pods/Headers/runtime/Metadata.h +981 -0
- package/pods/Headers/runtime/MetadataBuilder.h +72 -0
- package/pods/Headers/runtime/MetadataInlines.h +157 -0
- package/pods/Headers/runtime/ModuleInternal.h +59 -0
- package/pods/Headers/runtime/NSDataAdapter.h +13 -0
- package/pods/Headers/runtime/NativeScriptException.h +27 -0
- package/pods/Headers/runtime/ObjectManager.h +31 -0
- package/pods/Headers/runtime/OneByteStringResource.h +21 -0
- package/pods/Headers/runtime/Pointer.h +26 -0
- package/pods/Headers/runtime/PromiseProxy.h +15 -0
- package/pods/Headers/runtime/Reference.h +38 -0
- package/pods/Headers/runtime/Runtime.h +67 -0
- package/pods/Headers/runtime/RuntimeConfig.h +17 -0
- package/pods/Headers/runtime/SetTimeout.h +34 -0
- package/pods/Headers/runtime/SimpleAllocator.h +23 -0
- package/pods/Headers/runtime/StringHasher.h +315 -0
- package/pods/Headers/runtime/SymbolIterator.h +18 -0
- package/pods/Headers/runtime/SymbolLoader.h +27 -0
- package/pods/Headers/runtime/TNSDerivedClass.h +8 -0
- package/pods/Headers/runtime/TSHelpers.h +15 -0
- package/pods/Headers/runtime/Tasks.h +19 -0
- package/pods/Headers/runtime/UnmanagedType.h +21 -0
- package/pods/Headers/runtime/WeakRef.h +15 -0
- package/pods/Headers/runtime/Worker.h +26 -0
- package/pods/Headers/runtime/robin_hood.h +2184 -0
- package/pods/Headers/v8runtime/HostProxy.h +71 -0
- package/pods/Headers/v8runtime/JSIV8ValueConverter.h +70 -0
- package/pods/Headers/v8runtime/V8PointerValue.h +44 -0
- package/pods/Headers/v8runtime/V8Runtime.h +215 -0
- package/pods/Headers/v8runtime/V8RuntimeConfig.h +26 -0
- package/pods/Headers/v8runtime/V8RuntimeFactory.h +21 -0
- package/pods/NativeScript.podspec +68 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/PrivateHeaders/mason_native.h +0 -676
- package/platforms/ios/src/JSIModule.h +0 -217
- package/platforms/ios/src/JSIModule.mm +0 -2788
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+
#import <NativeScript/runtime/Runtime.h>
|
|
2
|
+
#import "cpp/include/mason_native.h"
|
|
3
|
+
#import <sstream>
|
|
4
|
+
|
|
5
|
+
using namespace std;
|
|
6
|
+
|
|
7
|
+
template <typename Lambda>
|
|
8
|
+
void AddFunctionToV8Object(v8::Local<v8::Object> target, const char *functionName, Lambda &&callback)
|
|
9
|
+
{
|
|
10
|
+
v8::Isolate *isolate = target->GetIsolate();
|
|
11
|
+
v8::Local<v8::FunctionTemplate> funcTemplate = v8::FunctionTemplate::New(isolate, callback);
|
|
12
|
+
v8::Local<v8::Function> function = funcTemplate->GetFunction(
|
|
13
|
+
isolate->GetCurrentContext())
|
|
14
|
+
.ToLocalChecked();
|
|
15
|
+
v8::Local<v8::String> funcName = v8::String::NewFromUtf8(isolate,
|
|
16
|
+
functionName)
|
|
17
|
+
.ToLocalChecked();
|
|
18
|
+
target->Set(isolate->GetCurrentContext(), funcName, function).Check();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#define GET_INT_ARG(index, name) \
|
|
22
|
+
auto name = info[index]->Int32Value(context).FromJust();
|
|
23
|
+
|
|
24
|
+
#define GET_FLOAT_ARG(index, name) \
|
|
25
|
+
auto name = (float)info[index]->NumberValue(context).FromJust();
|
|
26
|
+
|
|
27
|
+
#define CREATE_V8_MODULE(moduleName, lambda) \
|
|
28
|
+
v8::Local<v8::Context> ctx = (isolate)->GetCurrentContext(); \
|
|
29
|
+
v8::Local<v8::Object> global = ctx->Global(); \
|
|
30
|
+
v8::Local<v8::Object> moduleObject = v8::Object::New((isolate)); \
|
|
31
|
+
v8::Local<v8::String> moduleObjectName = v8::String::NewFromUtf8( \
|
|
32
|
+
(isolate), (moduleName), v8::NewStringType::kNormal) \
|
|
33
|
+
.ToLocalChecked(); \
|
|
34
|
+
lambda(moduleObject); \
|
|
35
|
+
global->Set(ctx, moduleObjectName, moduleObject).FromJust();
|
|
36
|
+
|
|
37
|
+
#define CREATE_FUNCTION(functionName, functionBody) \
|
|
38
|
+
{ \
|
|
39
|
+
AddFunctionToV8Object(moduleObject, functionName, [](const v8::FunctionCallbackInfo<v8::Value> &info) { \
|
|
40
|
+
V8_ENTER \
|
|
41
|
+
functionBody }); \
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
#define V8_ENTER \
|
|
45
|
+
v8::Isolate *isolate = info.GetIsolate(); \
|
|
46
|
+
v8::Local<v8::Context> context = isolate->GetCurrentContext();
|
|
47
|
+
|
|
48
|
+
#define RETURN_UNDEFINED \
|
|
49
|
+
info.GetReturnValue().SetUndefined();
|
|
50
|
+
|
|
51
|
+
#define MASON_ENTER \
|
|
52
|
+
auto mason = reinterpret_cast<void *>(info[0].As<v8::BigInt>()->Int64Value());
|
|
53
|
+
|
|
54
|
+
#define MASON_ENTER_WITH_NODE \
|
|
55
|
+
auto mason = reinterpret_cast<void *>(info[0].As<v8::BigInt>()->Int64Value()); \
|
|
56
|
+
auto node = reinterpret_cast<void *>(info[1].As<v8::BigInt>()->Int64Value());
|
|
57
|
+
|
|
58
|
+
#define MASON_ENTER_WITH_NODE_AND_STYLE \
|
|
59
|
+
auto mason = reinterpret_cast<void *>(info[0].As<v8::BigInt>()->Int64Value()); \
|
|
60
|
+
auto node = reinterpret_cast<void *>(info[1].As<v8::BigInt>()->Int64Value()); \
|
|
61
|
+
auto style = reinterpret_cast<void *>(info[2].As<v8::BigInt>()->Int64Value());
|
|
62
|
+
|
|
63
|
+
#define MASON_ENTER_WITH_STYLE \
|
|
64
|
+
auto style = reinterpret_cast<void *>(info[0].As<v8::BigInt>()->Int64Value());
|
|
65
|
+
|
|
66
|
+
#define MASON_UPDATE_NODE(arg) \
|
|
67
|
+
if (arg->BooleanValue(isolate)) \
|
|
68
|
+
{ \
|
|
69
|
+
[MasonReexports node_set_style:mason:node:style]; \
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
#define MASON_SET_NUMBER_PROPERTY(name, setter) \
|
|
73
|
+
CREATE_FUNCTION(name, { \
|
|
74
|
+
MASON_ENTER_WITH_NODE_AND_STYLE \
|
|
75
|
+
auto value = info[3]->Int32Value(context).FromJust(); \
|
|
76
|
+
[MasonReexports setter:style:value]; \
|
|
77
|
+
MASON_UPDATE_NODE(info[4]) \
|
|
78
|
+
RETURN_UNDEFINED \
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
#define MASON_SET_FLOAT_PROPERTY(name, setter) \
|
|
82
|
+
CREATE_FUNCTION(name, { \
|
|
83
|
+
MASON_ENTER_WITH_NODE_AND_STYLE \
|
|
84
|
+
auto value = info[3]->NumberValue(context).FromJust(); \
|
|
85
|
+
[MasonReexports setter:style:value]; \
|
|
86
|
+
MASON_UPDATE_NODE(info[4]) \
|
|
87
|
+
RETURN_UNDEFINED \
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
#define MASON_GET_NUMBER_PROPERTY(name, getter) \
|
|
91
|
+
CREATE_FUNCTION(name, { \
|
|
92
|
+
MASON_ENTER_WITH_STYLE \
|
|
93
|
+
info.GetReturnValue().Set([MasonReexports getter:style]); \
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
#define MASON_SET_LENGTH_PROPERTY(name, setter) \
|
|
97
|
+
CREATE_FUNCTION(name, { \
|
|
98
|
+
MASON_ENTER_WITH_NODE_AND_STYLE \
|
|
99
|
+
auto value = info[3]->NumberValue(context).FromJust(); \
|
|
100
|
+
auto value_type = info[4]->Int32Value(context).FromJust(); \
|
|
101
|
+
[MasonReexports setter:style:value:jsToLengthPercentageAutoType(value_type)]; \
|
|
102
|
+
MASON_UPDATE_NODE(info[5]) \
|
|
103
|
+
RETURN_UNDEFINED \
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
#define MASON_SET_LENGTH_PROPERTY_ALL_SIDES(name, setter) \
|
|
107
|
+
CREATE_FUNCTION(name, { \
|
|
108
|
+
MASON_ENTER_WITH_NODE_AND_STYLE \
|
|
109
|
+
auto value = info[3]->NumberValue(context).FromJust(); \
|
|
110
|
+
auto value_type = info[4]->Int32Value(context).FromJust(); \
|
|
111
|
+
[MasonReexports setter:style:value:jsToLengthPercentageAutoType(value_type)]; \
|
|
112
|
+
MASON_UPDATE_NODE(info[5]) \
|
|
113
|
+
RETURN_UNDEFINED \
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
#define MASON_SET_LENGTH_PROPERTY_NO_AUTO(name, setter) \
|
|
117
|
+
CREATE_FUNCTION(name, { \
|
|
118
|
+
MASON_ENTER_WITH_NODE_AND_STYLE \
|
|
119
|
+
auto value = info[3]->NumberValue(context).FromJust(); \
|
|
120
|
+
auto value_type = info[4]->Int32Value(context).FromJust(); \
|
|
121
|
+
[MasonReexports setter:style:value:jsToLengthPercentageType(value_type)]; \
|
|
122
|
+
MASON_UPDATE_NODE(info[5]) \
|
|
123
|
+
RETURN_UNDEFINED \
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
#define MASON_SET_LENGTH_PROPERTY_NO_AUTO_ALL_SIDES(name, setter) \
|
|
127
|
+
CREATE_FUNCTION(name, { \
|
|
128
|
+
MASON_ENTER_WITH_NODE_AND_STYLE \
|
|
129
|
+
auto value = info[3]->NumberValue(context).FromJust(); \
|
|
130
|
+
auto value_type = info[4]->Int32Value(context).FromJust(); \
|
|
131
|
+
[MasonReexports setter:style:value:jsToLengthPercentageType(value_type)]; \
|
|
132
|
+
MASON_UPDATE_NODE(info[5]) \
|
|
133
|
+
RETURN_UNDEFINED \
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
#define MASON_GET_LENGTH_PROPERTY(name, getter) \
|
|
137
|
+
CREATE_FUNCTION(name, { \
|
|
138
|
+
MASON_ENTER_WITH_STYLE \
|
|
139
|
+
info.GetReturnValue().Set(lengthPercentageAutoToJS(isolate, [MasonReexports getter:style])); \
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
#define MASON_GET_LENGTH_PROPERTY_NO_AUTO(name, getter) \
|
|
143
|
+
CREATE_FUNCTION(name, { \
|
|
144
|
+
MASON_ENTER_WITH_STYLE \
|
|
145
|
+
info.GetReturnValue().Set(lengthPercentageToJS(isolate, [MasonReexports getter:style])); \
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
#define MASON_SET_DIMENSION_PROPERTY(name, setter) \
|
|
149
|
+
CREATE_FUNCTION(name, { \
|
|
150
|
+
MASON_ENTER_WITH_NODE_AND_STYLE \
|
|
151
|
+
auto value = info[3]->NumberValue(context).FromJust(); \
|
|
152
|
+
auto value_type = info[4]->Int32Value(context).FromJust(); \
|
|
153
|
+
[MasonReexports setter:style:value:jsToDimensionType(value_type)]; \
|
|
154
|
+
MASON_UPDATE_NODE(info[5]) \
|
|
155
|
+
RETURN_UNDEFINED \
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
#define STRING_TO_V8_VALUE(value) \
|
|
159
|
+
v8::String::NewFromUtf8(isolate, value).ToLocalChecked()
|
|
160
|
+
|
|
161
|
+
#define DOUBLE_TO_V8_VALUE(value) \
|
|
162
|
+
v8::Number::New(isolate, value)
|
|
163
|
+
|
|
164
|
+
#define MASON_GET_DIMENSION_PROPERTY(name, getter) \
|
|
165
|
+
CREATE_FUNCTION(name, { \
|
|
166
|
+
MASON_ENTER_WITH_STYLE \
|
|
167
|
+
info.GetReturnValue().Set(dimensionToJS(isolate, [MasonReexports getter:style])); \
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
#define MASON_SET_SIZE_PROPERTY(name, setter) \
|
|
171
|
+
CREATE_FUNCTION(name, { \
|
|
172
|
+
MASON_ENTER_WITH_NODE_AND_STYLE \
|
|
173
|
+
auto width = info[3]->NumberValue(context).FromJust(); \
|
|
174
|
+
auto width_type = info[4]->Int32Value(context).FromJust(); \
|
|
175
|
+
auto height = info[3]->NumberValue(context).FromJust(); \
|
|
176
|
+
auto height_type = info[4]->Int32Value(context).FromJust(); \
|
|
177
|
+
[MasonReexports setter:style:width:jsToLengthPercentageType(width_type):height:jsToLengthPercentageType(height_type)]; \
|
|
178
|
+
MASON_UPDATE_NODE(info[7]) \
|
|
179
|
+
RETURN_UNDEFINED \
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
#define MASON_GET_SIZE_PROPERTY(name, getter) \
|
|
183
|
+
CREATE_FUNCTION(name, { \
|
|
184
|
+
MASON_ENTER_WITH_STYLE \
|
|
185
|
+
info.GetReturnValue().Set(sizeToJS(isolate, [MasonReexports getter:style])); \
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
#define MASON_GET_GRID_PROPERTY(name, getter) \
|
|
189
|
+
CREATE_FUNCTION(name, { \
|
|
190
|
+
MASON_ENTER_WITH_STYLE \
|
|
191
|
+
info.GetReturnValue().Set(gridPlacementToJS(isolate, [MasonReexports getter:style])); \
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
#define MASON_SET_GRID_PROPERTY(name, setter) \
|
|
195
|
+
CREATE_FUNCTION(name, { \
|
|
196
|
+
MASON_ENTER_WITH_NODE_AND_STYLE \
|
|
197
|
+
auto object = info[3].As<v8::Object>(); \
|
|
198
|
+
auto value = (short)object->Get(context, \
|
|
199
|
+
STRING_TO_V8_VALUE("value")) \
|
|
200
|
+
.ToLocalChecked() \
|
|
201
|
+
->Int32Value(context) \
|
|
202
|
+
.FromJust(); \
|
|
203
|
+
auto type = (int)object->Get(context, \
|
|
204
|
+
STRING_TO_V8_VALUE("type")) \
|
|
205
|
+
.ToLocalChecked() \
|
|
206
|
+
->Int32Value(context) \
|
|
207
|
+
.FromJust(); \
|
|
208
|
+
if (type >= 0 && type < 3) \
|
|
209
|
+
{ \
|
|
210
|
+
[MasonReexports setter:style:jsToGridPlacement(value, type)]; \
|
|
211
|
+
MASON_UPDATE_NODE(info[4]) \
|
|
212
|
+
} \
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
inline static v8::Local<v8::Value>
|
|
216
|
+
gridPlacementToJS(v8::Isolate *isolate, CMasonGridPlacement placement)
|
|
217
|
+
{
|
|
218
|
+
switch (placement.value_type)
|
|
219
|
+
{
|
|
220
|
+
case CMasonGridPlacementType::MasonGridPlacementTypeAuto:
|
|
221
|
+
{
|
|
222
|
+
v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
223
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("value"),
|
|
224
|
+
DOUBLE_TO_V8_VALUE(placement.value))
|
|
225
|
+
.Check();
|
|
226
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("type"),
|
|
227
|
+
DOUBLE_TO_V8_VALUE(0))
|
|
228
|
+
.Check();
|
|
229
|
+
return object;
|
|
230
|
+
}
|
|
231
|
+
case CMasonGridPlacementType::MasonGridPlacementTypeLine:
|
|
232
|
+
{
|
|
233
|
+
|
|
234
|
+
v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
235
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("value"),
|
|
236
|
+
DOUBLE_TO_V8_VALUE(placement.value))
|
|
237
|
+
.Check();
|
|
238
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("type"),
|
|
239
|
+
DOUBLE_TO_V8_VALUE(1))
|
|
240
|
+
.Check();
|
|
241
|
+
return object;
|
|
242
|
+
}
|
|
243
|
+
case CMasonGridPlacementType::MasonGridPlacementTypeSpan:
|
|
244
|
+
{
|
|
245
|
+
v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
246
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("value"),
|
|
247
|
+
DOUBLE_TO_V8_VALUE(placement.value))
|
|
248
|
+
.Check();
|
|
249
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("type"),
|
|
250
|
+
DOUBLE_TO_V8_VALUE(2))
|
|
251
|
+
.Check();
|
|
252
|
+
return object;
|
|
253
|
+
}
|
|
254
|
+
default:
|
|
255
|
+
return v8::Undefined(isolate);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
inline static CMasonGridPlacement jsToGridPlacement(short value, int value_type)
|
|
260
|
+
{
|
|
261
|
+
switch ((CMasonGridPlacementType)value_type)
|
|
262
|
+
{
|
|
263
|
+
case CMasonGridPlacementType::MasonGridPlacementTypeAuto:
|
|
264
|
+
{
|
|
265
|
+
return CMasonGridPlacement{0, CMasonGridPlacementType::MasonGridPlacementTypeAuto};
|
|
266
|
+
}
|
|
267
|
+
case CMasonGridPlacementType::MasonGridPlacementTypeLine:
|
|
268
|
+
{
|
|
269
|
+
return CMasonGridPlacement{value, CMasonGridPlacementType::MasonGridPlacementTypeLine};
|
|
270
|
+
}
|
|
271
|
+
case CMasonGridPlacementType::MasonGridPlacementTypeSpan:
|
|
272
|
+
{
|
|
273
|
+
return CMasonGridPlacement{value, CMasonGridPlacementType::MasonGridPlacementTypeSpan};
|
|
274
|
+
}
|
|
275
|
+
default:
|
|
276
|
+
// assert ??
|
|
277
|
+
return CMasonGridPlacement{0, CMasonGridPlacementType::MasonGridPlacementTypeAuto};
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
inline static v8::Local<v8::Value>
|
|
282
|
+
lengthPercentageToJS(v8::Isolate *isolate, CMasonLengthPercentage length)
|
|
283
|
+
{
|
|
284
|
+
switch (length.value_type)
|
|
285
|
+
{
|
|
286
|
+
case CMasonLengthPercentageType::MasonLengthPercentagePercent:
|
|
287
|
+
{
|
|
288
|
+
v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
289
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("value"),
|
|
290
|
+
DOUBLE_TO_V8_VALUE(length.value / 100))
|
|
291
|
+
.Check();
|
|
292
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("unit"),
|
|
293
|
+
STRING_TO_V8_VALUE("%"))
|
|
294
|
+
.Check();
|
|
295
|
+
return object;
|
|
296
|
+
}
|
|
297
|
+
case CMasonLengthPercentageType::MasonLengthPercentagePoints:
|
|
298
|
+
{
|
|
299
|
+
|
|
300
|
+
v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
301
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("value"),
|
|
302
|
+
DOUBLE_TO_V8_VALUE(length.value))
|
|
303
|
+
.Check();
|
|
304
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("unit"),
|
|
305
|
+
STRING_TO_V8_VALUE("px"))
|
|
306
|
+
.Check();
|
|
307
|
+
return object;
|
|
308
|
+
}
|
|
309
|
+
default:
|
|
310
|
+
return v8::Undefined(isolate);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
inline static CMasonLengthPercentage jsToLengthPercentage(float value, int value_type)
|
|
315
|
+
{
|
|
316
|
+
switch ((CMasonLengthPercentageType)value_type)
|
|
317
|
+
{
|
|
318
|
+
case CMasonLengthPercentageType::MasonLengthPercentagePercent:
|
|
319
|
+
{
|
|
320
|
+
return CMasonLengthPercentage{value, CMasonLengthPercentageType::MasonLengthPercentagePercent};
|
|
321
|
+
}
|
|
322
|
+
case CMasonLengthPercentageType::MasonLengthPercentagePoints:
|
|
323
|
+
{
|
|
324
|
+
return CMasonLengthPercentage{value, CMasonLengthPercentageType::MasonLengthPercentagePoints};
|
|
325
|
+
}
|
|
326
|
+
default:
|
|
327
|
+
// assert ??
|
|
328
|
+
return CMasonLengthPercentage{0, CMasonLengthPercentageType::MasonLengthPercentagePoints};
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
inline static CMasonLengthPercentageType jsToLengthPercentageType(int value_type)
|
|
333
|
+
{
|
|
334
|
+
switch ((CMasonLengthPercentageType)value_type)
|
|
335
|
+
{
|
|
336
|
+
case CMasonLengthPercentageType::MasonLengthPercentagePercent:
|
|
337
|
+
{
|
|
338
|
+
return CMasonLengthPercentageType::MasonLengthPercentagePercent;
|
|
339
|
+
}
|
|
340
|
+
case CMasonLengthPercentageType::MasonLengthPercentagePoints:
|
|
341
|
+
{
|
|
342
|
+
return CMasonLengthPercentageType::MasonLengthPercentagePoints;
|
|
343
|
+
}
|
|
344
|
+
default:
|
|
345
|
+
// assert invalid type ???
|
|
346
|
+
return CMasonLengthPercentageType::MasonLengthPercentagePoints;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
inline static v8::Local<v8::Value>
|
|
351
|
+
lengthPercentageAutoToJS(v8::Isolate *isolate, CMasonLengthPercentageAuto length)
|
|
352
|
+
{
|
|
353
|
+
switch (length.value_type)
|
|
354
|
+
{
|
|
355
|
+
case CMasonLengthPercentageAutoType::MasonLengthPercentageAutoAuto:
|
|
356
|
+
return STRING_TO_V8_VALUE("auto");
|
|
357
|
+
case CMasonLengthPercentageAutoType::MasonLengthPercentageAutoPercent:
|
|
358
|
+
{
|
|
359
|
+
v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
360
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("value"),
|
|
361
|
+
DOUBLE_TO_V8_VALUE(length.value / 100))
|
|
362
|
+
.Check();
|
|
363
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("unit"),
|
|
364
|
+
STRING_TO_V8_VALUE("%"))
|
|
365
|
+
.Check();
|
|
366
|
+
return object;
|
|
367
|
+
}
|
|
368
|
+
case CMasonLengthPercentageAutoType::MasonLengthPercentageAutoPoints:
|
|
369
|
+
{
|
|
370
|
+
v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
371
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("value"),
|
|
372
|
+
DOUBLE_TO_V8_VALUE(length.value))
|
|
373
|
+
.Check();
|
|
374
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("unit"),
|
|
375
|
+
STRING_TO_V8_VALUE("px"))
|
|
376
|
+
.Check();
|
|
377
|
+
|
|
378
|
+
return object;
|
|
379
|
+
}
|
|
380
|
+
default:
|
|
381
|
+
return v8::Undefined(isolate);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
inline static CMasonLengthPercentageAuto jsToLengthPercentageAuto(float value, int value_type)
|
|
386
|
+
{
|
|
387
|
+
switch ((CMasonLengthPercentageAutoType)value_type)
|
|
388
|
+
{
|
|
389
|
+
case CMasonLengthPercentageAutoType::MasonLengthPercentageAutoAuto:
|
|
390
|
+
return CMasonLengthPercentageAuto{value, CMasonLengthPercentageAutoType::MasonLengthPercentageAutoAuto};
|
|
391
|
+
case CMasonLengthPercentageAutoType::MasonLengthPercentageAutoPercent:
|
|
392
|
+
{
|
|
393
|
+
return CMasonLengthPercentageAuto{value, CMasonLengthPercentageAutoType::MasonLengthPercentageAutoPercent};
|
|
394
|
+
}
|
|
395
|
+
case CMasonLengthPercentageAutoType::MasonLengthPercentageAutoPoints:
|
|
396
|
+
{
|
|
397
|
+
return CMasonLengthPercentageAuto{value, CMasonLengthPercentageAutoType::MasonLengthPercentageAutoPoints};
|
|
398
|
+
}
|
|
399
|
+
default:
|
|
400
|
+
// assert invalid type ???
|
|
401
|
+
return CMasonLengthPercentageAuto{0, CMasonLengthPercentageAutoType::MasonLengthPercentageAutoPoints};
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
inline static CMasonLengthPercentageAutoType jsToLengthPercentageAutoType(int value_type)
|
|
406
|
+
{
|
|
407
|
+
switch ((CMasonLengthPercentageAutoType)value_type)
|
|
408
|
+
{
|
|
409
|
+
case CMasonLengthPercentageAutoType::MasonLengthPercentageAutoAuto:
|
|
410
|
+
return CMasonLengthPercentageAutoType::MasonLengthPercentageAutoAuto;
|
|
411
|
+
case CMasonLengthPercentageAutoType::MasonLengthPercentageAutoPercent:
|
|
412
|
+
{
|
|
413
|
+
return CMasonLengthPercentageAutoType::MasonLengthPercentageAutoPercent;
|
|
414
|
+
}
|
|
415
|
+
case CMasonLengthPercentageAutoType::MasonLengthPercentageAutoPoints:
|
|
416
|
+
{
|
|
417
|
+
return CMasonLengthPercentageAutoType::MasonLengthPercentageAutoPoints;
|
|
418
|
+
}
|
|
419
|
+
default:
|
|
420
|
+
// assert invalid type ???
|
|
421
|
+
return CMasonLengthPercentageAutoType::MasonLengthPercentageAutoAuto;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
inline static v8::Local<v8::Value> dimensionToJS(v8::Isolate *isolate, CMasonDimension dimension)
|
|
426
|
+
{
|
|
427
|
+
switch ((CMasonDimensionType)dimension.value_type)
|
|
428
|
+
{
|
|
429
|
+
case CMasonDimensionType::MasonDimensionAuto:
|
|
430
|
+
return STRING_TO_V8_VALUE("auto");
|
|
431
|
+
case CMasonDimensionType::MasonDimensionPercent:
|
|
432
|
+
{
|
|
433
|
+
|
|
434
|
+
v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
435
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("value"),
|
|
436
|
+
DOUBLE_TO_V8_VALUE(dimension.value / 100))
|
|
437
|
+
.Check();
|
|
438
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("unit"),
|
|
439
|
+
STRING_TO_V8_VALUE("%"))
|
|
440
|
+
.Check();
|
|
441
|
+
return object;
|
|
442
|
+
}
|
|
443
|
+
case CMasonDimensionType::MasonDimensionPoints:
|
|
444
|
+
{
|
|
445
|
+
v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
446
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("value"),
|
|
447
|
+
DOUBLE_TO_V8_VALUE(dimension.value))
|
|
448
|
+
.Check();
|
|
449
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("unit"),
|
|
450
|
+
STRING_TO_V8_VALUE("px"))
|
|
451
|
+
.Check();
|
|
452
|
+
return object;
|
|
453
|
+
}
|
|
454
|
+
default:
|
|
455
|
+
return v8::Undefined(isolate);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
inline static CMasonDimension jsToDimension(float value, int value_type)
|
|
460
|
+
{
|
|
461
|
+
switch ((CMasonDimensionType)value_type)
|
|
462
|
+
{
|
|
463
|
+
case CMasonDimensionType::MasonDimensionAuto:
|
|
464
|
+
return CMasonDimension{value, CMasonDimensionType::MasonDimensionAuto};
|
|
465
|
+
case CMasonDimensionType::MasonDimensionPercent:
|
|
466
|
+
{
|
|
467
|
+
return CMasonDimension{value, CMasonDimensionType::MasonDimensionPercent};
|
|
468
|
+
}
|
|
469
|
+
case CMasonDimensionType::MasonDimensionPoints:
|
|
470
|
+
{
|
|
471
|
+
return CMasonDimension{value, CMasonDimensionType::MasonDimensionPoints};
|
|
472
|
+
}
|
|
473
|
+
default:
|
|
474
|
+
// assert invalid type ???
|
|
475
|
+
return CMasonDimension{0, CMasonDimensionType::MasonDimensionPoints};
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
inline static CMasonDimensionType jsToDimensionType(int value_type)
|
|
480
|
+
{
|
|
481
|
+
switch ((CMasonDimensionType)value_type)
|
|
482
|
+
{
|
|
483
|
+
case CMasonDimensionType::MasonDimensionAuto:
|
|
484
|
+
return CMasonDimensionType::MasonDimensionAuto;
|
|
485
|
+
case CMasonDimensionType::MasonDimensionPercent:
|
|
486
|
+
{
|
|
487
|
+
return CMasonDimensionType::MasonDimensionPercent;
|
|
488
|
+
}
|
|
489
|
+
case CMasonDimensionType::MasonDimensionPoints:
|
|
490
|
+
{
|
|
491
|
+
return CMasonDimensionType::MasonDimensionPoints;
|
|
492
|
+
}
|
|
493
|
+
default:
|
|
494
|
+
// assert invalid type ???
|
|
495
|
+
return CMasonDimensionType::MasonDimensionAuto;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
// inline static v8::Local<v8::Value> sizeToJS(v8::Isolate *isolate, CMasonDimensionSize size) {
|
|
500
|
+
// v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
501
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("width"),
|
|
502
|
+
// dimensionToJS(isolate, size.width)).Check();
|
|
503
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("height"),
|
|
504
|
+
// dimensionToJS(isolate, size.width)).Check();
|
|
505
|
+
// return object;
|
|
506
|
+
// }
|
|
507
|
+
|
|
508
|
+
inline static v8::Local<v8::Object>
|
|
509
|
+
sizeToJS(v8::Isolate *isolate, CMasonLengthPercentageSize size)
|
|
510
|
+
{
|
|
511
|
+
|
|
512
|
+
v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
513
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("width"),
|
|
514
|
+
lengthPercentageToJS(isolate, size.width))
|
|
515
|
+
.Check();
|
|
516
|
+
object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("height"),
|
|
517
|
+
lengthPercentageToJS(isolate, size.width))
|
|
518
|
+
.Check();
|
|
519
|
+
return object;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// inline static v8::Local<v8::Object>
|
|
523
|
+
// sizeToJS(v8::Isolate *isolate, CMasonLengthPercentageAutoSize size) {
|
|
524
|
+
//
|
|
525
|
+
// v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
526
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("width"),
|
|
527
|
+
// lengthPercentageAutoToJS(isolate, size.width)).Check();
|
|
528
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("height"),
|
|
529
|
+
// lengthPercentageAutoToJS(isolate, size.width)).Check();
|
|
530
|
+
// return object;
|
|
531
|
+
// }
|
|
532
|
+
|
|
533
|
+
// inline static v8::Local<v8::Object> rectToJS(v8::Isolate *isolate, CMasonDimensionRect rect) {
|
|
534
|
+
//
|
|
535
|
+
// v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
536
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("left"),
|
|
537
|
+
// dimensionToJS(isolate, rect.left)).Check();
|
|
538
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("right"),
|
|
539
|
+
// dimensionToJS(isolate, rect.right)).Check();
|
|
540
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("top"),
|
|
541
|
+
// dimensionToJS(isolate, rect.top)).Check();
|
|
542
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("bottom"),
|
|
543
|
+
// dimensionToJS(isolate, rect.bottom)).Check();
|
|
544
|
+
// return object;
|
|
545
|
+
//
|
|
546
|
+
// }
|
|
547
|
+
|
|
548
|
+
// inline static v8::Local<v8::Object>
|
|
549
|
+
// rectToJS(v8::Isolate *isolate, CMasonLengthPercentageRect rect) {
|
|
550
|
+
//
|
|
551
|
+
// v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
552
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("left"),
|
|
553
|
+
// lengthPercentageToJS(isolate, rect.left)).Check();
|
|
554
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("right"),
|
|
555
|
+
// lengthPercentageToJS(isolate, rect.right)).Check();
|
|
556
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("top"),
|
|
557
|
+
// lengthPercentageToJS(isolate, rect.top)).Check();
|
|
558
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("bottom"),
|
|
559
|
+
// lengthPercentageToJS(isolate, rect.bottom)).Check();
|
|
560
|
+
// return object;
|
|
561
|
+
//
|
|
562
|
+
// }
|
|
563
|
+
|
|
564
|
+
// inline static v8::Local<v8::Object>
|
|
565
|
+
// rectToJS(v8::Isolate *isolate, CMasonLengthPercentageAutoRect rect) {
|
|
566
|
+
// v8::Local<v8::Object> object = v8::Object::New((isolate));
|
|
567
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("left"),
|
|
568
|
+
// lengthPercentageAutoToJS(isolate, rect.left)).Check();
|
|
569
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("right"),
|
|
570
|
+
// lengthPercentageAutoToJS(isolate, rect.right)).Check();
|
|
571
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("top"),
|
|
572
|
+
// lengthPercentageAutoToJS(isolate, rect.top)).Check();
|
|
573
|
+
// object->Set(isolate->GetCurrentContext(), STRING_TO_V8_VALUE("bottom"),
|
|
574
|
+
// lengthPercentageAutoToJS(isolate, rect.bottom)).Check();
|
|
575
|
+
// return object;
|
|
576
|
+
//
|
|
577
|
+
// }
|
|
578
|
+
|
|
579
|
+
@interface MasonV8ModuleInstaller : NSObject
|
|
580
|
+
|
|
581
|
+
- (void)install;
|
|
582
|
+
|
|
583
|
+
@end
|