diff --git a/.gitignore b/.gitignore index 32b70e14f..08b088cd4 100644 --- a/.gitignore +++ b/.gitignore @@ -89,3 +89,6 @@ DerivedData/ compile_commands.json cmake-build-test +/local.properties +/.gradle +.kotlin diff --git a/Package.swift b/Package.swift index 38edb7334..d6fec9d80 100644 --- a/Package.swift +++ b/Package.swift @@ -11,14 +11,17 @@ let package = Package( products: [ .library( name: "MapCore", + type: .dynamic, targets: ["MapCore"] ), .library( name: "MapCoreSharedModule", + type: .static, targets: ["MapCoreSharedModule"] ), .library( name: "MapCoreSharedModuleCpp", + type: .static, targets: ["MapCoreSharedModuleCpp"] ), ], @@ -131,7 +134,12 @@ let package = Package( "MapCoreSharedModuleCpp" ], path: "bridging/ios", - publicHeadersPath: "" + publicHeadersPath: "", + linkerSettings: [ + .linkedFramework("Foundation"), + .linkedFramework("CoreFoundation"), + .linkedLibrary("objc"), + ] ), .target( name: "MapCoreSharedModuleCpp", @@ -146,6 +154,7 @@ let package = Package( cxxSettings: [ .headerSearchPath("public"), .headerSearchPath("src"), + .headerSearchPath("../external/djinni/support-lib/objc"), .headerSearchPath("src/external/pugixml"), .headerSearchPath("src/external/gpc"), .headerSearchPath("src/logger"), diff --git a/android/build.gradle b/android/build.gradle index 8743fc970..689efc7dc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -17,7 +17,7 @@ buildscript { } ext{ - agp_version = "8.13.1" + agp_version = "8.13.2" kotlin_version = "2.2.0" ksp_version = "2.2.0-2.0.2" } @@ -62,7 +62,7 @@ android { externalNativeBuild { cmake { arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON" - cppFlags "-std=c++17 -frtti -fexceptions -O2" + cppFlags "-std=c++17 -frtti -fexceptions" } } } @@ -102,14 +102,16 @@ android { debug { externalNativeBuild { cmake { - cppFlags "-DDEBUG" + arguments "-DCMAKE_BUILD_TYPE=Debug" + cppFlags "-DDEBUG -O0 -g" } } } release { externalNativeBuild { cmake { - cppFlags "-DNDEBUG" + arguments "-DCMAKE_BUILD_TYPE=Release" + cppFlags "-DNDEBUG -O2 -g0" } } ndk { @@ -208,4 +210,4 @@ clean.doLast { project.delete("${projectDir}/build") project.delete("${projectDir}/.cxx") project.delete("${projectDir}/.gradle") -} \ No newline at end of file +} diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaInstancedShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaInstancedShaderInterface.kt new file mode 100644 index 000000000..56a083312 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaInstancedShaderInterface.kt @@ -0,0 +1,21 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.AlphaInstancedShaderInterface + +actual class KMAlphaInstancedShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as AlphaInstancedShaderInterface + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } +} + +internal fun KMAlphaInstancedShaderInterface.asPlatform(): AlphaInstancedShaderInterface = nativeHandle as AlphaInstancedShaderInterface +public fun AlphaInstancedShaderInterface.asKmp(): KMAlphaInstancedShaderInterface = KMAlphaInstancedShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaShaderInterface.kt new file mode 100644 index 000000000..23b027f15 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaShaderInterface.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.AlphaShaderInterface + +actual class KMAlphaShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as AlphaShaderInterface + + actual fun updateAlpha(value: Float) { + native.updateAlpha(value) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } +} + +internal fun KMAlphaShaderInterface.asPlatform(): AlphaShaderInterface = nativeHandle as AlphaShaderInterface +public fun AlphaShaderInterface.asKmp(): KMAlphaShaderInterface = KMAlphaShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAnchor.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAnchor.kt new file mode 100644 index 000000000..fd98dbf72 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAnchor.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMAnchor = io.openmobilemaps.mapscore.shared.map.layers.text.Anchor + +internal fun KMAnchor.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.text.Anchor = this +public fun io.openmobilemaps.mapscore.shared.map.layers.text.Anchor.asKmp(): KMAnchor = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBlendMode.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBlendMode.kt new file mode 100644 index 000000000..341033bd3 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBlendMode.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMBlendMode = io.openmobilemaps.mapscore.shared.graphics.shader.BlendMode + +internal fun KMBlendMode.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.shader.BlendMode = this +public fun io.openmobilemaps.mapscore.shared.graphics.shader.BlendMode.asKmp(): KMBlendMode = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBoundingBoxInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBoundingBoxInterface.kt new file mode 100644 index 000000000..1b2a49ebf --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBoundingBoxInterface.kt @@ -0,0 +1,54 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.coordinates.BoundingBoxInterface + +actual class KMBoundingBoxInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as BoundingBoxInterface + + actual fun addPoint(p: KMCoord) { + native.addPoint(p.asPlatform()) + } + + actual fun asRectCoord(): KMRectCoord { + val result = native.asRectCoord() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord).asKmp() + } + + actual fun getCenter(): KMCoord { + val result = native.getCenter() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp() + } + + actual fun getMin(): KMCoord { + val result = native.getMin() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp() + } + + actual fun getMax(): KMCoord { + val result = native.getMax() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp() + } + + actual fun getSystemIdentifier(): Int { + val result = native.getSystemIdentifier() + return result + } + + actual companion object + { + + actual fun create(systemIdentifier: Int): KMBoundingBoxInterface { + val result = BoundingBoxInterface.create(systemIdentifier) + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.BoundingBoxInterface).asKmp() + } + } +} + +internal fun KMBoundingBoxInterface.asPlatform(): BoundingBoxInterface = nativeHandle as BoundingBoxInterface +public fun BoundingBoxInterface.asKmp(): KMBoundingBoxInterface = KMBoundingBoxInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfig.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfig.kt new file mode 100644 index 000000000..6c11cb8c5 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfig.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMCamera3dConfig = io.openmobilemaps.mapscore.shared.map.Camera3dConfig + +internal fun KMCamera3dConfig.asPlatform(): io.openmobilemaps.mapscore.shared.map.Camera3dConfig = this +public fun io.openmobilemaps.mapscore.shared.map.Camera3dConfig.asKmp(): KMCamera3dConfig = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfigFactory.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfigFactory.kt new file mode 100644 index 000000000..80dc9cf0e --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfigFactory.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.Camera3dConfigFactory + +actual class KMCamera3dConfigFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as Camera3dConfigFactory + + actual companion object + { + + actual fun getBasicConfig(): KMCamera3dConfig { + val result = Camera3dConfigFactory.getBasicConfig() + return (result as io.openmobilemaps.mapscore.shared.map.Camera3dConfig).asKmp() + } + + actual fun getRestorConfig(): KMCamera3dConfig { + val result = Camera3dConfigFactory.getRestorConfig() + return (result as io.openmobilemaps.mapscore.shared.map.Camera3dConfig).asKmp() + } + } +} + +internal fun KMCamera3dConfigFactory.asPlatform(): Camera3dConfigFactory = nativeHandle as Camera3dConfigFactory +public fun Camera3dConfigFactory.asKmp(): KMCamera3dConfigFactory = KMCamera3dConfigFactory(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterface.kt new file mode 100644 index 000000000..50f43e0ab --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterface.kt @@ -0,0 +1,70 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.CameraInterface + +actual interface KMCameraInterface +{ + + actual fun getVpMatrix(): ArrayList + + actual fun getScalingFactor(): Double + + actual fun getOrigin(): KMVec3D + + actual fun viewportSizeChanged() +} + +private class KMCameraInterfacePlatformWrapper(internal val nativeHandle: CameraInterface) : KMCameraInterface +{ + + override fun getVpMatrix(): ArrayList { + val result = nativeHandle.getVpMatrix() + return ArrayList(result.map { it }) + } + + override fun getScalingFactor(): Double { + val result = nativeHandle.getScalingFactor() + return result + } + + override fun getOrigin(): KMVec3D { + val result = nativeHandle.getOrigin() + return (result as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp() + } + + override fun viewportSizeChanged() { + nativeHandle.viewportSizeChanged() + } +} + +private class KMCameraInterfacePlatformProxy(private val delegate: KMCameraInterface) : CameraInterface() +{ + + override fun getVpMatrix(): ArrayList { + val result = delegate.getVpMatrix() + return ArrayList(result.map { it }) + } + + override fun getScalingFactor(): Double { + val result = delegate.getScalingFactor() + return result + } + + override fun getOrigin(): io.openmobilemaps.mapscore.shared.graphics.common.Vec3D { + val result = delegate.getOrigin() + return result.asPlatform() + } + + override fun viewportSizeChanged() { + delegate.viewportSizeChanged() + } +} + +internal fun KMCameraInterface.asPlatform(): CameraInterface = when (this) { + is KMCameraInterfacePlatformWrapper -> this.nativeHandle + else -> KMCameraInterfacePlatformProxy(this) +} +public fun CameraInterface.asKmp(): KMCameraInterface = KMCameraInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolation.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolation.kt new file mode 100644 index 000000000..7415db7e5 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolation.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMCameraInterpolation = io.openmobilemaps.mapscore.shared.map.CameraInterpolation + +internal fun KMCameraInterpolation.asPlatform(): io.openmobilemaps.mapscore.shared.map.CameraInterpolation = this +public fun io.openmobilemaps.mapscore.shared.map.CameraInterpolation.asKmp(): KMCameraInterpolation = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolationValue.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolationValue.kt new file mode 100644 index 000000000..3bdb2b775 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolationValue.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMCameraInterpolationValue = io.openmobilemaps.mapscore.shared.map.CameraInterpolationValue + +internal fun KMCameraInterpolationValue.asPlatform(): io.openmobilemaps.mapscore.shared.map.CameraInterpolationValue = this +public fun io.openmobilemaps.mapscore.shared.map.CameraInterpolationValue.asKmp(): KMCameraInterpolationValue = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleD.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleD.kt new file mode 100644 index 000000000..412cab83f --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleD.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMCircleD = io.openmobilemaps.mapscore.shared.graphics.common.CircleD + +internal fun KMCircleD.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.CircleD = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.CircleD.asKmp(): KMCircleD = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleF.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleF.kt new file mode 100644 index 000000000..dbccaba15 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleF.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMCircleF = io.openmobilemaps.mapscore.shared.graphics.common.CircleF + +internal fun KMCircleF.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.CircleF = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.CircleF.asKmp(): KMCircleF = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleI.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleI.kt new file mode 100644 index 000000000..cd0e418e0 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleI.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMCircleI = io.openmobilemaps.mapscore.shared.graphics.common.CircleI + +internal fun KMCircleI.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.CircleI = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.CircleI.asKmp(): KMCircleI = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColor.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColor.kt new file mode 100644 index 000000000..b399758fb --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColor.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMColor = io.openmobilemaps.mapscore.shared.graphics.common.Color + +internal fun KMColor.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.Color = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.Color.asKmp(): KMColor = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorCircleShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorCircleShaderInterface.kt new file mode 100644 index 000000000..8a41bdbc2 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorCircleShaderInterface.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.ColorCircleShaderInterface + +actual class KMColorCircleShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as ColorCircleShaderInterface + + actual fun setColor(red: Float, green: Float, blue: Float, alpha: Float) { + native.setColor(red, green, blue, alpha) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } +} + +internal fun KMColorCircleShaderInterface.asPlatform(): ColorCircleShaderInterface = nativeHandle as ColorCircleShaderInterface +public fun ColorCircleShaderInterface.asKmp(): KMColorCircleShaderInterface = KMColorCircleShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorShaderInterface.kt new file mode 100644 index 000000000..ab4107e74 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorShaderInterface.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.ColorShaderInterface + +actual class KMColorShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as ColorShaderInterface + + actual fun setColor(red: Float, green: Float, blue: Float, alpha: Float) { + native.setColor(red, green, blue, alpha) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } +} + +internal fun KMColorShaderInterface.asPlatform(): ColorShaderInterface = nativeHandle as ColorShaderInterface +public fun ColorShaderInterface.asKmp(): KMColorShaderInterface = KMColorShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorStateList.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorStateList.kt new file mode 100644 index 000000000..ae5f7dcbb --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorStateList.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from styling.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMColorStateList = io.openmobilemaps.mapscore.shared.map.layers.ColorStateList + +internal fun KMColorStateList.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.ColorStateList = this +public fun io.openmobilemaps.mapscore.shared.map.layers.ColorStateList.asKmp(): KMColorStateList = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputeObjectInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputeObjectInterface.kt new file mode 100644 index 000000000..233dfc0d9 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputeObjectInterface.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.ComputeObjectInterface + +actual interface KMComputeObjectInterface +{ + + actual fun compute(context: KMRenderingContextInterface, vpMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double) +} + +private class KMComputeObjectInterfacePlatformWrapper(internal val nativeHandle: ComputeObjectInterface) : KMComputeObjectInterface +{ + + override fun compute(context: KMRenderingContextInterface, vpMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double) { + nativeHandle.compute(context.asPlatform(), vpMatrix, origin.asPlatform(), screenPixelAsRealMeterFactor) + } +} + +private class KMComputeObjectInterfacePlatformProxy(private val delegate: KMComputeObjectInterface) : ComputeObjectInterface() +{ + + override fun compute(context: io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface, vpMatrix: Long, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D, screenPixelAsRealMeterFactor: Double) { + delegate.compute((context as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp(), vpMatrix, (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp(), screenPixelAsRealMeterFactor) + } +} + +internal fun KMComputeObjectInterface.asPlatform(): ComputeObjectInterface = when (this) { + is KMComputeObjectInterfacePlatformWrapper -> this.nativeHandle + else -> KMComputeObjectInterfacePlatformProxy(this) +} +public fun ComputeObjectInterface.asKmp(): KMComputeObjectInterface = KMComputeObjectInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputePassInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputePassInterface.kt new file mode 100644 index 000000000..b408145ea --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputePassInterface.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.ComputePassInterface + +actual interface KMComputePassInterface +{ + + actual fun getComputeObjects(): ArrayList +} + +private class KMComputePassInterfacePlatformWrapper(internal val nativeHandle: ComputePassInterface) : KMComputePassInterface +{ + + override fun getComputeObjects(): ArrayList { + val result = nativeHandle.getComputeObjects() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.graphics.objects.ComputeObjectInterface).asKmp() }) + } +} + +private class KMComputePassInterfacePlatformProxy(private val delegate: KMComputePassInterface) : ComputePassInterface() +{ + + override fun getComputeObjects(): ArrayList { + val result = delegate.getComputeObjects() + return ArrayList(result.map { it.asPlatform() }) + } +} + +internal fun KMComputePassInterface.asPlatform(): ComputePassInterface = when (this) { + is KMComputePassInterfacePlatformWrapper -> this.nativeHandle + else -> KMComputePassInterfacePlatformProxy(this) +} +public fun ComputePassInterface.asKmp(): KMComputePassInterface = KMComputePassInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoord.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoord.kt new file mode 100644 index 000000000..de2aa9e11 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoord.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMCoord = io.openmobilemaps.mapscore.shared.map.coordinates.Coord + +internal fun KMCoord.asPlatform(): io.openmobilemaps.mapscore.shared.map.coordinates.Coord = this +public fun io.openmobilemaps.mapscore.shared.map.coordinates.Coord.asKmp(): KMCoord = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConversionHelperInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConversionHelperInterface.kt new file mode 100644 index 000000000..064d7c537 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConversionHelperInterface.kt @@ -0,0 +1,59 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.coordinates.CoordinateConversionHelperInterface + +actual class KMCoordinateConversionHelperInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as CoordinateConversionHelperInterface + + actual fun registerConverter(converter: KMCoordinateConverterInterface) { + native.registerConverter(converter.asPlatform()) + } + + actual fun convert(to: Int, coordinate: KMCoord): KMCoord { + val result = native.convert(to, coordinate.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp() + } + + actual fun convertRect(to: Int, rect: KMRectCoord): KMRectCoord { + val result = native.convertRect(to, rect.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord).asKmp() + } + + actual fun convertRectToRenderSystem(rect: KMRectCoord): KMRectCoord { + val result = native.convertRectToRenderSystem(rect.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord).asKmp() + } + + actual fun convertQuad(to: Int, quad: KMQuadCoord): KMQuadCoord { + val result = native.convertQuad(to, quad.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.QuadCoord).asKmp() + } + + actual fun convertQuadToRenderSystem(quad: KMQuadCoord): KMQuadCoord { + val result = native.convertQuadToRenderSystem(quad.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.QuadCoord).asKmp() + } + + actual fun convertToRenderSystem(coordinate: KMCoord): KMCoord { + val result = native.convertToRenderSystem(coordinate.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp() + } + + actual companion object + { + + actual fun independentInstance(): KMCoordinateConversionHelperInterface { + val result = CoordinateConversionHelperInterface.independentInstance() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.CoordinateConversionHelperInterface).asKmp() + } + } +} + +internal fun KMCoordinateConversionHelperInterface.asPlatform(): CoordinateConversionHelperInterface = nativeHandle as CoordinateConversionHelperInterface +public fun CoordinateConversionHelperInterface.asKmp(): KMCoordinateConversionHelperInterface = KMCoordinateConversionHelperInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConverterInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConverterInterface.kt new file mode 100644 index 000000000..5874b9972 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConverterInterface.kt @@ -0,0 +1,60 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.coordinates.CoordinateConverterInterface + +actual interface KMCoordinateConverterInterface +{ + + actual fun convert(coordinate: KMCoord): KMCoord + + actual fun getFrom(): Int + + actual fun getTo(): Int +} + +private class KMCoordinateConverterInterfacePlatformWrapper(internal val nativeHandle: CoordinateConverterInterface) : KMCoordinateConverterInterface +{ + + override fun convert(coordinate: KMCoord): KMCoord { + val result = nativeHandle.convert(coordinate.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp() + } + + override fun getFrom(): Int { + val result = nativeHandle.getFrom() + return result + } + + override fun getTo(): Int { + val result = nativeHandle.getTo() + return result + } +} + +private class KMCoordinateConverterInterfacePlatformProxy(private val delegate: KMCoordinateConverterInterface) : CoordinateConverterInterface() +{ + + override fun convert(coordinate: io.openmobilemaps.mapscore.shared.map.coordinates.Coord): io.openmobilemaps.mapscore.shared.map.coordinates.Coord { + val result = delegate.convert((coordinate as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp()) + return result.asPlatform() + } + + override fun getFrom(): Int { + val result = delegate.getFrom() + return result + } + + override fun getTo(): Int { + val result = delegate.getTo() + return result + } +} + +internal fun KMCoordinateConverterInterface.asPlatform(): CoordinateConverterInterface = when (this) { + is KMCoordinateConverterInterfacePlatformWrapper -> this.nativeHandle + else -> KMCoordinateConverterInterfacePlatformProxy(this) +} +public fun CoordinateConverterInterface.asKmp(): KMCoordinateConverterInterface = KMCoordinateConverterInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemFactory.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemFactory.kt new file mode 100644 index 000000000..ec4166977 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemFactory.kt @@ -0,0 +1,45 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.coordinates.CoordinateSystemFactory + +actual class KMCoordinateSystemFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as CoordinateSystemFactory + + actual companion object + { + + actual fun getEpsg2056System(): KMMapCoordinateSystem { + val result = CoordinateSystemFactory.getEpsg2056System() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.MapCoordinateSystem).asKmp() + } + + actual fun getEpsg3857System(): KMMapCoordinateSystem { + val result = CoordinateSystemFactory.getEpsg3857System() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.MapCoordinateSystem).asKmp() + } + + actual fun getEpsg4326System(): KMMapCoordinateSystem { + val result = CoordinateSystemFactory.getEpsg4326System() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.MapCoordinateSystem).asKmp() + } + + actual fun getEpsg21781System(): KMMapCoordinateSystem { + val result = CoordinateSystemFactory.getEpsg21781System() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.MapCoordinateSystem).asKmp() + } + + actual fun getUnitSphereSystem(): KMMapCoordinateSystem { + val result = CoordinateSystemFactory.getUnitSphereSystem() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.MapCoordinateSystem).asKmp() + } + } +} + +internal fun KMCoordinateSystemFactory.asPlatform(): CoordinateSystemFactory = nativeHandle as CoordinateSystemFactory +public fun CoordinateSystemFactory.asKmp(): KMCoordinateSystemFactory = KMCoordinateSystemFactory(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemIdentifiers.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemIdentifiers.kt new file mode 100644 index 000000000..856263013 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemIdentifiers.kt @@ -0,0 +1,60 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.coordinates.CoordinateSystemIdentifiers + +actual class KMCoordinateSystemIdentifiers actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as CoordinateSystemIdentifiers + + actual companion object + { + + actual fun RENDERSYSTEM(): Int { + val result = CoordinateSystemIdentifiers.RENDERSYSTEM() + return result + } + + actual fun EPSG3857(): Int { + val result = CoordinateSystemIdentifiers.EPSG3857() + return result + } + + actual fun EPSG4326(): Int { + val result = CoordinateSystemIdentifiers.EPSG4326() + return result + } + + actual fun EPSG2056(): Int { + val result = CoordinateSystemIdentifiers.EPSG2056() + return result + } + + actual fun EPSG21781(): Int { + val result = CoordinateSystemIdentifiers.EPSG21781() + return result + } + + actual fun UnitSphere(): Int { + val result = CoordinateSystemIdentifiers.UnitSphere() + return result + } + + actual fun fromCrsIdentifier(identifier: String): Int { + val result = CoordinateSystemIdentifiers.fromCrsIdentifier(identifier) + return result + } + + actual fun unitToMeterFactor(coordinateSystemIdentifier: Int): Double { + val result = CoordinateSystemIdentifiers.unitToMeterFactor(coordinateSystemIdentifier) + return result + } + } +} + +internal fun KMCoordinateSystemIdentifiers.asPlatform(): CoordinateSystemIdentifiers = nativeHandle as CoordinateSystemIdentifiers +public fun CoordinateSystemIdentifiers.asKmp(): KMCoordinateSystemIdentifiers = KMCoordinateSystemIdentifiers(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCpuPerformanceLoggerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCpuPerformanceLoggerInterface.kt new file mode 100644 index 000000000..de4932d11 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCpuPerformanceLoggerInterface.kt @@ -0,0 +1,35 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.CpuPerformanceLoggerInterface + +actual class KMCpuPerformanceLoggerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as CpuPerformanceLoggerInterface + + actual fun asPerformanceLoggerInterface(): KMPerformanceLoggerInterface { + val result = native.asPerformanceLoggerInterface() + return (result as io.openmobilemaps.mapscore.shared.map.PerformanceLoggerInterface).asKmp() + } + + actual companion object + { + + actual fun create(): KMCpuPerformanceLoggerInterface { + val result = CpuPerformanceLoggerInterface.create() + return (result as io.openmobilemaps.mapscore.shared.map.CpuPerformanceLoggerInterface).asKmp() + } + + actual fun createSpecifically(numBuckets: Int, bucketSizeMs: Long): KMCpuPerformanceLoggerInterface { + val result = CpuPerformanceLoggerInterface.createSpecifically(numBuckets, bucketSizeMs) + return (result as io.openmobilemaps.mapscore.shared.map.CpuPerformanceLoggerInterface).asKmp() + } + } +} + +internal fun KMCpuPerformanceLoggerInterface.asPlatform(): CpuPerformanceLoggerInterface = nativeHandle as CpuPerformanceLoggerInterface +public fun CpuPerformanceLoggerInterface.asKmp(): KMCpuPerformanceLoggerInterface = KMCpuPerformanceLoggerInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataLoaderResult.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataLoaderResult.kt new file mode 100644 index 000000000..d252bccb8 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataLoaderResult.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMDataLoaderResult = io.openmobilemaps.mapscore.shared.map.loader.DataLoaderResult + +internal fun KMDataLoaderResult.asPlatform(): io.openmobilemaps.mapscore.shared.map.loader.DataLoaderResult = this +public fun io.openmobilemaps.mapscore.shared.map.loader.DataLoaderResult.asKmp(): KMDataLoaderResult = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTiled2dMapLayerConfigs.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTiled2dMapLayerConfigs.kt new file mode 100644 index 000000000..6e63b01e6 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTiled2dMapLayerConfigs.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.DefaultTiled2dMapLayerConfigs + +actual class KMDefaultTiled2dMapLayerConfigs actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as DefaultTiled2dMapLayerConfigs + + actual companion object + { + + actual fun webMercator(layerName: String, urlFormat: String): KMTiled2dMapLayerConfig { + val result = DefaultTiled2dMapLayerConfigs.webMercator(layerName, urlFormat) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapLayerConfig).asKmp() + } + + actual fun webMercatorCustom(layerName: String, urlFormat: String, zoomInfo: KMTiled2dMapZoomInfo?, minZoomLevel: Int, maxZoomLevel: Int): KMTiled2dMapLayerConfig { + val result = DefaultTiled2dMapLayerConfigs.webMercatorCustom(layerName, urlFormat, zoomInfo?.let { it.asPlatform() }, minZoomLevel, maxZoomLevel) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapLayerConfig).asKmp() + } + + actual fun epsg4326(layerName: String, urlFormat: String): KMTiled2dMapLayerConfig { + val result = DefaultTiled2dMapLayerConfigs.epsg4326(layerName, urlFormat) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapLayerConfig).asKmp() + } + + actual fun epsg4326Custom(layerName: String, urlFormat: String, zoomInfo: KMTiled2dMapZoomInfo, minZoomLevel: Int, maxZoomLevel: Int): KMTiled2dMapLayerConfig { + val result = DefaultTiled2dMapLayerConfigs.epsg4326Custom(layerName, urlFormat, zoomInfo.asPlatform(), minZoomLevel, maxZoomLevel) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapLayerConfig).asKmp() + } + } +} + +internal fun KMDefaultTiled2dMapLayerConfigs.asPlatform(): DefaultTiled2dMapLayerConfigs = nativeHandle as DefaultTiled2dMapLayerConfigs +public fun DefaultTiled2dMapLayerConfigs.asKmp(): KMDefaultTiled2dMapLayerConfigs = KMDefaultTiled2dMapLayerConfigs(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTouchHandlerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTouchHandlerInterface.kt new file mode 100644 index 000000000..fb5246787 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTouchHandlerInterface.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.controls.DefaultTouchHandlerInterface + +actual class KMDefaultTouchHandlerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as DefaultTouchHandlerInterface + + actual companion object + { + + actual fun create(scheduler: KMSchedulerInterface, density: Float): KMTouchHandlerInterface { + val result = DefaultTouchHandlerInterface.create(scheduler.asPlatform(), density) + return (result as io.openmobilemaps.mapscore.shared.map.controls.TouchHandlerInterface).asKmp() + } + } +} + +internal fun KMDefaultTouchHandlerInterface.asPlatform(): DefaultTouchHandlerInterface = nativeHandle as DefaultTouchHandlerInterface +public fun DefaultTouchHandlerInterface.asKmp(): KMDefaultTouchHandlerInterface = KMDefaultTouchHandlerInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMElevationInterpolationShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMElevationInterpolationShaderInterface.kt new file mode 100644 index 000000000..3b755e953 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMElevationInterpolationShaderInterface.kt @@ -0,0 +1,21 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.ElevationInterpolationShaderInterface + +actual class KMElevationInterpolationShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as ElevationInterpolationShaderInterface + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } +} + +internal fun KMElevationInterpolationShaderInterface.asPlatform(): ElevationInterpolationShaderInterface = nativeHandle as ElevationInterpolationShaderInterface +public fun ElevationInterpolationShaderInterface.asKmp(): KMElevationInterpolationShaderInterface = KMElevationInterpolationShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManager.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManager.kt new file mode 100644 index 000000000..32fda3e93 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManager.kt @@ -0,0 +1,49 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.ErrorManager + +actual class KMErrorManager actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as ErrorManager + + actual fun addTiledLayerError(error: KMTiledLayerError) { + native.addTiledLayerError(error.asPlatform()) + } + + actual fun removeError(url: String) { + native.removeError(url) + } + + actual fun removeAllErrorsForLayer(layerName: String) { + native.removeAllErrorsForLayer(layerName) + } + + actual fun clearAllErrors() { + native.clearAllErrors() + } + + actual fun addErrorListener(listener: KMErrorManagerListener) { + native.addErrorListener(listener.asPlatform()) + } + + actual fun removeErrorListener(listener: KMErrorManagerListener) { + native.removeErrorListener(listener.asPlatform()) + } + + actual companion object + { + + actual fun create(): KMErrorManager { + val result = ErrorManager.create() + return (result as io.openmobilemaps.mapscore.shared.map.ErrorManager).asKmp() + } + } +} + +internal fun KMErrorManager.asPlatform(): ErrorManager = nativeHandle as ErrorManager +public fun ErrorManager.asKmp(): KMErrorManager = KMErrorManager(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManagerListener.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManagerListener.kt new file mode 100644 index 000000000..ce4054e4f --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManagerListener.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.ErrorManagerListener + +actual interface KMErrorManagerListener +{ + + actual fun onTiledLayerErrorStateChanged(errors: ArrayList) +} + +private class KMErrorManagerListenerPlatformWrapper(internal val nativeHandle: ErrorManagerListener) : KMErrorManagerListener +{ + + override fun onTiledLayerErrorStateChanged(errors: ArrayList) { + nativeHandle.onTiledLayerErrorStateChanged(ArrayList(errors.map { it.asPlatform() })) + } +} + +private class KMErrorManagerListenerPlatformProxy(private val delegate: KMErrorManagerListener) : ErrorManagerListener() +{ + + override fun onTiledLayerErrorStateChanged(errors: ArrayList) { + delegate.onTiledLayerErrorStateChanged(ArrayList(errors.map { (it as io.openmobilemaps.mapscore.shared.map.TiledLayerError).asKmp() })) + } +} + +internal fun KMErrorManagerListener.asPlatform(): ErrorManagerListener = when (this) { + is KMErrorManagerListenerPlatformWrapper -> this.nativeHandle + else -> KMErrorManagerListenerPlatformProxy(this) +} +public fun ErrorManagerListener.asKmp(): KMErrorManagerListener = KMErrorManagerListenerPlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerDelegateInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerDelegateInterface.kt new file mode 100644 index 000000000..23c8b9d48 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerDelegateInterface.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from exception_logger.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.utils.ExceptionLoggerDelegateInterface + +actual interface KMExceptionLoggerDelegateInterface +{ + + actual fun logMessage(errorDomain: String, code: Int, customValues: HashMap, functionName: String, file: String, line: Int) +} + +private class KMExceptionLoggerDelegateInterfacePlatformWrapper(internal val nativeHandle: ExceptionLoggerDelegateInterface) : KMExceptionLoggerDelegateInterface +{ + + override fun logMessage(errorDomain: String, code: Int, customValues: HashMap, functionName: String, file: String, line: Int) { + nativeHandle.logMessage(errorDomain, code, HashMap(customValues.map { it.key to it.value }.toMap()), functionName, file, line) + } +} + +private class KMExceptionLoggerDelegateInterfacePlatformProxy(private val delegate: KMExceptionLoggerDelegateInterface) : ExceptionLoggerDelegateInterface() +{ + + override fun logMessage(errorDomain: String, code: Int, customValues: HashMap, functionName: String, file: String, line: Int) { + delegate.logMessage(errorDomain, code, HashMap(customValues.map { it.key to it.value }.toMap()), functionName, file, line) + } +} + +internal fun KMExceptionLoggerDelegateInterface.asPlatform(): ExceptionLoggerDelegateInterface = when (this) { + is KMExceptionLoggerDelegateInterfacePlatformWrapper -> this.nativeHandle + else -> KMExceptionLoggerDelegateInterfacePlatformProxy(this) +} +public fun ExceptionLoggerDelegateInterface.asKmp(): KMExceptionLoggerDelegateInterface = KMExceptionLoggerDelegateInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerInterface.kt new file mode 100644 index 000000000..56791eeff --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerInterface.kt @@ -0,0 +1,24 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from exception_logger.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.utils.ExceptionLoggerInterface + +actual class KMExceptionLoggerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as ExceptionLoggerInterface + + actual companion object + { + + actual fun setLoggerDelegate(delegate: KMExceptionLoggerDelegateInterface) { + ExceptionLoggerInterface.setLoggerDelegate(delegate.asPlatform()) + } + } +} + +internal fun KMExceptionLoggerInterface.asPlatform(): ExceptionLoggerInterface = nativeHandle as ExceptionLoggerInterface +public fun ExceptionLoggerInterface.asKmp(): KMExceptionLoggerInterface = KMExceptionLoggerInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExecutionEnvironment.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExecutionEnvironment.kt new file mode 100644 index 000000000..aab4c7c1e --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExecutionEnvironment.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMExecutionEnvironment = io.openmobilemaps.mapscore.shared.map.scheduling.ExecutionEnvironment + +internal fun KMExecutionEnvironment.asPlatform(): io.openmobilemaps.mapscore.shared.map.scheduling.ExecutionEnvironment = this +public fun io.openmobilemaps.mapscore.shared.map.scheduling.ExecutionEnvironment.asKmp(): KMExecutionEnvironment = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFeatureInfoValueFactory.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFeatureInfoValueFactory.kt new file mode 100644 index 000000000..8b82f3d57 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFeatureInfoValueFactory.kt @@ -0,0 +1,55 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.FeatureInfoValueFactory + +actual class KMFeatureInfoValueFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as FeatureInfoValueFactory + + actual companion object + { + + actual fun createString(value: String): KMVectorLayerFeatureInfoValue { + val result = FeatureInfoValueFactory.createString(value) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfoValue).asKmp() + } + + actual fun createDouble(value: Double): KMVectorLayerFeatureInfoValue { + val result = FeatureInfoValueFactory.createDouble(value) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfoValue).asKmp() + } + + actual fun createInt(value: Long): KMVectorLayerFeatureInfoValue { + val result = FeatureInfoValueFactory.createInt(value) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfoValue).asKmp() + } + + actual fun createBool(value: Boolean): KMVectorLayerFeatureInfoValue { + val result = FeatureInfoValueFactory.createBool(value) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfoValue).asKmp() + } + + actual fun createColor(value: KMColor): KMVectorLayerFeatureInfoValue { + val result = FeatureInfoValueFactory.createColor(value.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfoValue).asKmp() + } + + actual fun createListFloat(value: ArrayList): KMVectorLayerFeatureInfoValue { + val result = FeatureInfoValueFactory.createListFloat(ArrayList(value.map { it })) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfoValue).asKmp() + } + + actual fun createListString(value: ArrayList): KMVectorLayerFeatureInfoValue { + val result = FeatureInfoValueFactory.createListString(ArrayList(value.map { it })) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfoValue).asKmp() + } + } +} + +internal fun KMFeatureInfoValueFactory.asPlatform(): FeatureInfoValueFactory = nativeHandle as FeatureInfoValueFactory +public fun FeatureInfoValueFactory.asKmp(): KMFeatureInfoValueFactory = KMFeatureInfoValueFactory(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFont.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFont.kt new file mode 100644 index 000000000..9f32fe061 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFont.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMFont = io.openmobilemaps.mapscore.shared.map.loader.Font + +internal fun KMFont.asPlatform(): io.openmobilemaps.mapscore.shared.map.loader.Font = this +public fun io.openmobilemaps.mapscore.shared.map.loader.Font.asKmp(): KMFont = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontData.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontData.kt new file mode 100644 index 000000000..3741ac54b --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontData.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMFontData = io.openmobilemaps.mapscore.shared.map.loader.FontData + +internal fun KMFontData.asPlatform(): io.openmobilemaps.mapscore.shared.map.loader.FontData = this +public fun io.openmobilemaps.mapscore.shared.map.loader.FontData.asKmp(): KMFontData = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontGlyph.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontGlyph.kt new file mode 100644 index 000000000..2ab3f81e8 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontGlyph.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMFontGlyph = io.openmobilemaps.mapscore.shared.map.loader.FontGlyph + +internal fun KMFontGlyph.asPlatform(): io.openmobilemaps.mapscore.shared.map.loader.FontGlyph = this +public fun io.openmobilemaps.mapscore.shared.map.loader.FontGlyph.asKmp(): KMFontGlyph = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderInterface.kt new file mode 100644 index 000000000..4be62bf27 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderInterface.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.loader.FontLoaderInterface + +actual interface KMFontLoaderInterface +{ + + actual fun loadFont(font: KMFont): KMFontLoaderResult +} + +private class KMFontLoaderInterfacePlatformWrapper(internal val nativeHandle: FontLoaderInterface) : KMFontLoaderInterface +{ + + override fun loadFont(font: KMFont): KMFontLoaderResult { + val result = nativeHandle.loadFont(font.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.loader.FontLoaderResult).asKmp() + } +} + +private class KMFontLoaderInterfacePlatformProxy(private val delegate: KMFontLoaderInterface) : FontLoaderInterface() +{ + + override fun loadFont(font: io.openmobilemaps.mapscore.shared.map.loader.Font): io.openmobilemaps.mapscore.shared.map.loader.FontLoaderResult { + val result = delegate.loadFont((font as io.openmobilemaps.mapscore.shared.map.loader.Font).asKmp()) + return result.asPlatform() + } +} + +internal fun KMFontLoaderInterface.asPlatform(): FontLoaderInterface = when (this) { + is KMFontLoaderInterfacePlatformWrapper -> this.nativeHandle + else -> KMFontLoaderInterfacePlatformProxy(this) +} +public fun FontLoaderInterface.asKmp(): KMFontLoaderInterface = KMFontLoaderInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderResult.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderResult.kt new file mode 100644 index 000000000..9b87ca50f --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderResult.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +actual class KMFontLoaderResult actual public constructor( + imageData: KMTextureHolderInterface?, + fontData: KMFontData?, + status: KMLoaderStatus, +) { + actual val imageData: KMTextureHolderInterface? = imageData + actual val fontData: KMFontData? = fontData + actual val status: KMLoaderStatus = status +} + +internal fun KMFontLoaderResult.asPlatform(): io.openmobilemaps.mapscore.shared.map.loader.FontLoaderResult = io.openmobilemaps.mapscore.shared.map.loader.FontLoaderResult( + imageData = imageData?.let { it.asPlatform() }, + fontData = fontData?.let { it.asPlatform() }, + status = status.asPlatform(), +) +public fun io.openmobilemaps.mapscore.shared.map.loader.FontLoaderResult.asKmp(): KMFontLoaderResult = KMFontLoaderResult( + imageData = this.imageData?.let { (it as io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface).asKmp() }, + fontData = this.fontData?.let { (it as io.openmobilemaps.mapscore.shared.map.loader.FontData).asKmp() }, + status = (this.status as io.openmobilemaps.mapscore.shared.map.loader.LoaderStatus).asKmp(), +) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontWrapper.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontWrapper.kt new file mode 100644 index 000000000..28a17bfec --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontWrapper.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMFontWrapper = io.openmobilemaps.mapscore.shared.map.loader.FontWrapper + +internal fun KMFontWrapper.asPlatform(): io.openmobilemaps.mapscore.shared.map.loader.FontWrapper = this +public fun io.openmobilemaps.mapscore.shared.map.loader.FontWrapper.asKmp(): KMFontWrapper = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFormattedStringEntry.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFormattedStringEntry.kt new file mode 100644 index 000000000..9f51f9925 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFormattedStringEntry.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMFormattedStringEntry = io.openmobilemaps.mapscore.shared.map.layers.text.FormattedStringEntry + +internal fun KMFormattedStringEntry.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.text.FormattedStringEntry = this +public fun io.openmobilemaps.mapscore.shared.map.layers.text.FormattedStringEntry.asKmp(): KMFormattedStringEntry = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonFeatureParserInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonFeatureParserInterface.kt new file mode 100644 index 000000000..7d9678958 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonFeatureParserInterface.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from geo_json_parser.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.GeoJsonFeatureParserInterface + +actual class KMGeoJsonFeatureParserInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as GeoJsonFeatureParserInterface + + actual fun parse(geoJson: String): ArrayList? { + val result = native.parse(geoJson) + return result?.let { ArrayList(it.map { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfo).asKmp() }) } + } + + actual fun parseWithPointGeometry(geoJson: String): ArrayList? { + val result = native.parseWithPointGeometry(geoJson) + return result?.let { ArrayList(it.map { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.GeoJsonPoint).asKmp() }) } + } + + actual fun parseWithLineGeometry(geoJson: String): ArrayList? { + val result = native.parseWithLineGeometry(geoJson) + return result?.let { ArrayList(it.map { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.GeoJsonLine).asKmp() }) } + } + + actual companion object + { + + actual fun create(): KMGeoJsonFeatureParserInterface { + val result = GeoJsonFeatureParserInterface.create() + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.GeoJsonFeatureParserInterface).asKmp() + } + } +} + +internal fun KMGeoJsonFeatureParserInterface.asPlatform(): GeoJsonFeatureParserInterface = nativeHandle as GeoJsonFeatureParserInterface +public fun GeoJsonFeatureParserInterface.asKmp(): KMGeoJsonFeatureParserInterface = KMGeoJsonFeatureParserInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonHelperInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonHelperInterface.kt new file mode 100644 index 000000000..575413503 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonHelperInterface.kt @@ -0,0 +1,35 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from geo_json_parser.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.GeoJsonHelperInterface + +actual class KMGeoJsonHelperInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as GeoJsonHelperInterface + + actual fun geoJsonStringFromFeatureInfo(point: KMGeoJsonPoint): String { + val result = native.geoJsonStringFromFeatureInfo(point.asPlatform()) + return result + } + + actual fun geoJsonStringFromFeatureInfos(points: ArrayList): String { + val result = native.geoJsonStringFromFeatureInfos(ArrayList(points.map { it.asPlatform() })) + return result + } + + actual companion object + { + + actual fun independentInstance(): KMGeoJsonHelperInterface { + val result = GeoJsonHelperInterface.independentInstance() + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.GeoJsonHelperInterface).asKmp() + } + } +} + +internal fun KMGeoJsonHelperInterface.asPlatform(): GeoJsonHelperInterface = nativeHandle as GeoJsonHelperInterface +public fun GeoJsonHelperInterface.asKmp(): KMGeoJsonHelperInterface = KMGeoJsonHelperInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonLine.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonLine.kt new file mode 100644 index 000000000..fb4ad2251 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonLine.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from geo_json_parser.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMGeoJsonLine = io.openmobilemaps.mapscore.shared.map.layers.tiled.GeoJsonLine + +internal fun KMGeoJsonLine.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.GeoJsonLine = this +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.GeoJsonLine.asKmp(): KMGeoJsonLine = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonPoint.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonPoint.kt new file mode 100644 index 000000000..e6b1e8c06 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonPoint.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from geo_json_parser.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMGeoJsonPoint = io.openmobilemaps.mapscore.shared.map.layers.tiled.GeoJsonPoint + +internal fun KMGeoJsonPoint.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.GeoJsonPoint = this +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.GeoJsonPoint.asKmp(): KMGeoJsonPoint = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGlyphDescription.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGlyphDescription.kt new file mode 100644 index 000000000..2c623134c --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGlyphDescription.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMGlyphDescription = io.openmobilemaps.mapscore.shared.graphics.objects.GlyphDescription + +internal fun KMGlyphDescription.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.objects.GlyphDescription = this +public fun io.openmobilemaps.mapscore.shared.graphics.objects.GlyphDescription.asKmp(): KMGlyphDescription = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectFactoryInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectFactoryInterface.kt new file mode 100644 index 000000000..697dda80c --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectFactoryInterface.kt @@ -0,0 +1,204 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectFactoryInterface + +actual interface KMGraphicsObjectFactoryInterface +{ + + actual fun createQuad(shader: KMShaderProgramInterface): KMQuad2dInterface + + actual fun createQuadTessellated(shader: KMShaderProgramInterface): KMQuad2dInterface + + actual fun createPolygon(shader: KMShaderProgramInterface): KMPolygon2dInterface + + actual fun createPolygonTessellated(shader: KMShaderProgramInterface): KMPolygon2dInterface + + actual fun createIcosahedronObject(shader: KMShaderProgramInterface): KMIcosahedronInterface + + actual fun createQuadInstanced(shader: KMShaderProgramInterface): KMQuad2dInstancedInterface + + actual fun createQuadStretchedInstanced(shader: KMShaderProgramInterface): KMQuad2dStretchedInstancedInterface + + actual fun createLineGroup(shader: KMShaderProgramInterface): KMLineGroup2dInterface + + actual fun createPolygonGroup(shader: KMShaderProgramInterface): KMPolygonGroup2dInterface + + actual fun createPolygonPatternGroup(shader: KMShaderProgramInterface): KMPolygonPatternGroup2dInterface + + actual fun createQuadMask(is3d: Boolean): KMQuad2dInterface + + actual fun createPolygonMask(is3d: Boolean): KMPolygon2dInterface + + actual fun createPolygonMaskTessellated(is3d: Boolean): KMPolygon2dInterface + + actual fun createText(shader: KMShaderProgramInterface): KMTextInterface + + actual fun createTextInstanced(shader: KMShaderProgramInterface): KMTextInstancedInterface +} + +private class KMGraphicsObjectFactoryInterfacePlatformWrapper(internal val nativeHandle: GraphicsObjectFactoryInterface) : KMGraphicsObjectFactoryInterface +{ + + override fun createQuad(shader: KMShaderProgramInterface): KMQuad2dInterface { + val result = nativeHandle.createQuad(shader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.Quad2dInterface).asKmp() + } + + override fun createQuadTessellated(shader: KMShaderProgramInterface): KMQuad2dInterface { + val result = nativeHandle.createQuadTessellated(shader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.Quad2dInterface).asKmp() + } + + override fun createPolygon(shader: KMShaderProgramInterface): KMPolygon2dInterface { + val result = nativeHandle.createPolygon(shader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.Polygon2dInterface).asKmp() + } + + override fun createPolygonTessellated(shader: KMShaderProgramInterface): KMPolygon2dInterface { + val result = nativeHandle.createPolygonTessellated(shader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.Polygon2dInterface).asKmp() + } + + override fun createIcosahedronObject(shader: KMShaderProgramInterface): KMIcosahedronInterface { + val result = nativeHandle.createIcosahedronObject(shader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.IcosahedronInterface).asKmp() + } + + override fun createQuadInstanced(shader: KMShaderProgramInterface): KMQuad2dInstancedInterface { + val result = nativeHandle.createQuadInstanced(shader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.Quad2dInstancedInterface).asKmp() + } + + override fun createQuadStretchedInstanced(shader: KMShaderProgramInterface): KMQuad2dStretchedInstancedInterface { + val result = nativeHandle.createQuadStretchedInstanced(shader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.Quad2dStretchedInstancedInterface).asKmp() + } + + override fun createLineGroup(shader: KMShaderProgramInterface): KMLineGroup2dInterface { + val result = nativeHandle.createLineGroup(shader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.LineGroup2dInterface).asKmp() + } + + override fun createPolygonGroup(shader: KMShaderProgramInterface): KMPolygonGroup2dInterface { + val result = nativeHandle.createPolygonGroup(shader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.PolygonGroup2dInterface).asKmp() + } + + override fun createPolygonPatternGroup(shader: KMShaderProgramInterface): KMPolygonPatternGroup2dInterface { + val result = nativeHandle.createPolygonPatternGroup(shader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.PolygonPatternGroup2dInterface).asKmp() + } + + override fun createQuadMask(is3d: Boolean): KMQuad2dInterface { + val result = nativeHandle.createQuadMask(is3d) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.Quad2dInterface).asKmp() + } + + override fun createPolygonMask(is3d: Boolean): KMPolygon2dInterface { + val result = nativeHandle.createPolygonMask(is3d) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.Polygon2dInterface).asKmp() + } + + override fun createPolygonMaskTessellated(is3d: Boolean): KMPolygon2dInterface { + val result = nativeHandle.createPolygonMaskTessellated(is3d) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.Polygon2dInterface).asKmp() + } + + override fun createText(shader: KMShaderProgramInterface): KMTextInterface { + val result = nativeHandle.createText(shader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.TextInterface).asKmp() + } + + override fun createTextInstanced(shader: KMShaderProgramInterface): KMTextInstancedInterface { + val result = nativeHandle.createTextInstanced(shader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.TextInstancedInterface).asKmp() + } +} + +private class KMGraphicsObjectFactoryInterfacePlatformProxy(private val delegate: KMGraphicsObjectFactoryInterface) : GraphicsObjectFactoryInterface() +{ + + override fun createQuad(shader: io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface): io.openmobilemaps.mapscore.shared.graphics.objects.Quad2dInterface { + val result = delegate.createQuad((shader as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp()) + return result.asPlatform() + } + + override fun createQuadTessellated(shader: io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface): io.openmobilemaps.mapscore.shared.graphics.objects.Quad2dInterface { + val result = delegate.createQuadTessellated((shader as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp()) + return result.asPlatform() + } + + override fun createPolygon(shader: io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface): io.openmobilemaps.mapscore.shared.graphics.objects.Polygon2dInterface { + val result = delegate.createPolygon((shader as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp()) + return result.asPlatform() + } + + override fun createPolygonTessellated(shader: io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface): io.openmobilemaps.mapscore.shared.graphics.objects.Polygon2dInterface { + val result = delegate.createPolygonTessellated((shader as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp()) + return result.asPlatform() + } + + override fun createIcosahedronObject(shader: io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface): io.openmobilemaps.mapscore.shared.graphics.objects.IcosahedronInterface { + val result = delegate.createIcosahedronObject((shader as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp()) + return result.asPlatform() + } + + override fun createQuadInstanced(shader: io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface): io.openmobilemaps.mapscore.shared.graphics.objects.Quad2dInstancedInterface { + val result = delegate.createQuadInstanced((shader as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp()) + return result.asPlatform() + } + + override fun createQuadStretchedInstanced(shader: io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface): io.openmobilemaps.mapscore.shared.graphics.objects.Quad2dStretchedInstancedInterface { + val result = delegate.createQuadStretchedInstanced((shader as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp()) + return result.asPlatform() + } + + override fun createLineGroup(shader: io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface): io.openmobilemaps.mapscore.shared.graphics.objects.LineGroup2dInterface { + val result = delegate.createLineGroup((shader as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp()) + return result.asPlatform() + } + + override fun createPolygonGroup(shader: io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface): io.openmobilemaps.mapscore.shared.graphics.objects.PolygonGroup2dInterface { + val result = delegate.createPolygonGroup((shader as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp()) + return result.asPlatform() + } + + override fun createPolygonPatternGroup(shader: io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface): io.openmobilemaps.mapscore.shared.graphics.objects.PolygonPatternGroup2dInterface { + val result = delegate.createPolygonPatternGroup((shader as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp()) + return result.asPlatform() + } + + override fun createQuadMask(is3d: Boolean): io.openmobilemaps.mapscore.shared.graphics.objects.Quad2dInterface { + val result = delegate.createQuadMask(is3d) + return result.asPlatform() + } + + override fun createPolygonMask(is3d: Boolean): io.openmobilemaps.mapscore.shared.graphics.objects.Polygon2dInterface { + val result = delegate.createPolygonMask(is3d) + return result.asPlatform() + } + + override fun createPolygonMaskTessellated(is3d: Boolean): io.openmobilemaps.mapscore.shared.graphics.objects.Polygon2dInterface { + val result = delegate.createPolygonMaskTessellated(is3d) + return result.asPlatform() + } + + override fun createText(shader: io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface): io.openmobilemaps.mapscore.shared.graphics.objects.TextInterface { + val result = delegate.createText((shader as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp()) + return result.asPlatform() + } + + override fun createTextInstanced(shader: io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface): io.openmobilemaps.mapscore.shared.graphics.objects.TextInstancedInterface { + val result = delegate.createTextInstanced((shader as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp()) + return result.asPlatform() + } +} + +internal fun KMGraphicsObjectFactoryInterface.asPlatform(): GraphicsObjectFactoryInterface = when (this) { + is KMGraphicsObjectFactoryInterfacePlatformWrapper -> this.nativeHandle + else -> KMGraphicsObjectFactoryInterfacePlatformProxy(this) +} +public fun GraphicsObjectFactoryInterface.asKmp(): KMGraphicsObjectFactoryInterface = KMGraphicsObjectFactoryInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectInterface.kt new file mode 100644 index 000000000..40844ec23 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectInterface.kt @@ -0,0 +1,86 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface + +actual interface KMGraphicsObjectInterface +{ + + actual fun isReady(): Boolean + + actual fun setup(context: KMRenderingContextInterface) + + actual fun clear() + + actual fun setIsInverseMasked(inversed: Boolean) + + actual fun setDebugLabel(label: String) + + actual fun render(context: KMRenderingContextInterface, renderPass: KMRenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: KMVec3D, isMasked: Boolean, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) +} + +private class KMGraphicsObjectInterfacePlatformWrapper(internal val nativeHandle: GraphicsObjectInterface) : KMGraphicsObjectInterface +{ + + override fun isReady(): Boolean { + val result = nativeHandle.isReady() + return result + } + + override fun setup(context: KMRenderingContextInterface) { + nativeHandle.setup(context.asPlatform()) + } + + override fun clear() { + nativeHandle.clear() + } + + override fun setIsInverseMasked(inversed: Boolean) { + nativeHandle.setIsInverseMasked(inversed) + } + + override fun setDebugLabel(label: String) { + nativeHandle.setDebugLabel(label) + } + + override fun render(context: KMRenderingContextInterface, renderPass: KMRenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: KMVec3D, isMasked: Boolean, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) { + nativeHandle.render(context.asPlatform(), renderPass.asPlatform(), vpMatrix, mMatrix, origin.asPlatform(), isMasked, screenPixelAsRealMeterFactor, isScreenSpaceCoords) + } +} + +private class KMGraphicsObjectInterfacePlatformProxy(private val delegate: KMGraphicsObjectInterface) : GraphicsObjectInterface() +{ + + override fun isReady(): Boolean { + val result = delegate.isReady() + return result + } + + override fun setup(context: io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface) { + delegate.setup((context as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp()) + } + + override fun clear() { + delegate.clear() + } + + override fun setIsInverseMasked(inversed: Boolean) { + delegate.setIsInverseMasked(inversed) + } + + override fun setDebugLabel(label: String) { + delegate.setDebugLabel(label) + } + + override fun render(context: io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface, renderPass: io.openmobilemaps.mapscore.shared.graphics.RenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D, isMasked: Boolean, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) { + delegate.render((context as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp(), (renderPass as io.openmobilemaps.mapscore.shared.graphics.RenderPassConfig).asKmp(), vpMatrix, mMatrix, (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp(), isMasked, screenPixelAsRealMeterFactor, isScreenSpaceCoords) + } +} + +internal fun KMGraphicsObjectInterface.asPlatform(): GraphicsObjectInterface = when (this) { + is KMGraphicsObjectInterfacePlatformWrapper -> this.nativeHandle + else -> KMGraphicsObjectInterfacePlatformProxy(this) +} +public fun GraphicsObjectInterface.asKmp(): KMGraphicsObjectInterface = KMGraphicsObjectInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconFactory.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconFactory.kt new file mode 100644 index 000000000..6e0d5fd56 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconFactory.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.icon.IconFactory + +actual class KMIconFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as IconFactory + + actual companion object + { + + actual fun createIcon(identifier: String, coordinate: KMCoord, texture: KMTextureHolderInterface, iconSize: KMVec2F, scaleType: KMIconType, blendMode: KMBlendMode): KMIconInfoInterface { + val result = IconFactory.createIcon(identifier, coordinate.asPlatform(), texture.asPlatform(), iconSize.asPlatform(), scaleType.asPlatform(), blendMode.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.layers.icon.IconInfoInterface).asKmp() + } + + actual fun createIconWithAnchor(identifier: String, coordinate: KMCoord, texture: KMTextureHolderInterface, iconSize: KMVec2F, scaleType: KMIconType, blendMode: KMBlendMode, iconAnchor: KMVec2F): KMIconInfoInterface { + val result = IconFactory.createIconWithAnchor(identifier, coordinate.asPlatform(), texture.asPlatform(), iconSize.asPlatform(), scaleType.asPlatform(), blendMode.asPlatform(), iconAnchor.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.layers.icon.IconInfoInterface).asKmp() + } + } +} + +internal fun KMIconFactory.asPlatform(): IconFactory = nativeHandle as IconFactory +public fun IconFactory.asKmp(): KMIconFactory = KMIconFactory(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconInfoInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconInfoInterface.kt new file mode 100644 index 000000000..5e46e422c --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconInfoInterface.kt @@ -0,0 +1,63 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.icon.IconInfoInterface + +actual class KMIconInfoInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as IconInfoInterface + + actual fun getIdentifier(): String { + val result = native.getIdentifier() + return result + } + + actual fun getTexture(): KMTextureHolderInterface { + val result = native.getTexture() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface).asKmp() + } + + actual fun setCoordinate(coord: KMCoord) { + native.setCoordinate(coord.asPlatform()) + } + + actual fun getCoordinate(): KMCoord { + val result = native.getCoordinate() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp() + } + + actual fun setIconSize(size: KMVec2F) { + native.setIconSize(size.asPlatform()) + } + + actual fun getIconSize(): KMVec2F { + val result = native.getIconSize() + return (result as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp() + } + + actual fun setType(scaleType: KMIconType) { + native.setType(scaleType.asPlatform()) + } + + actual fun getType(): KMIconType { + val result = native.getType() + return (result as io.openmobilemaps.mapscore.shared.map.layers.icon.IconType).asKmp() + } + + actual fun getIconAnchor(): KMVec2F { + val result = native.getIconAnchor() + return (result as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp() + } + + actual fun getBlendMode(): KMBlendMode { + val result = native.getBlendMode() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.BlendMode).asKmp() + } +} + +internal fun KMIconInfoInterface.asPlatform(): IconInfoInterface = nativeHandle as IconInfoInterface +public fun IconInfoInterface.asKmp(): KMIconInfoInterface = KMIconInfoInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerCallbackInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerCallbackInterface.kt new file mode 100644 index 000000000..32cab35dd --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerCallbackInterface.kt @@ -0,0 +1,48 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.icon.IconLayerCallbackInterface + +actual interface KMIconLayerCallbackInterface +{ + + actual fun onClickConfirmed(icons: ArrayList): Boolean + + actual fun onLongPress(icons: ArrayList): Boolean +} + +private class KMIconLayerCallbackInterfacePlatformWrapper(internal val nativeHandle: IconLayerCallbackInterface) : KMIconLayerCallbackInterface +{ + + override fun onClickConfirmed(icons: ArrayList): Boolean { + val result = nativeHandle.onClickConfirmed(ArrayList(icons.map { it.asPlatform() })) + return result + } + + override fun onLongPress(icons: ArrayList): Boolean { + val result = nativeHandle.onLongPress(ArrayList(icons.map { it.asPlatform() })) + return result + } +} + +private class KMIconLayerCallbackInterfacePlatformProxy(private val delegate: KMIconLayerCallbackInterface) : IconLayerCallbackInterface() +{ + + override fun onClickConfirmed(icons: ArrayList): Boolean { + val result = delegate.onClickConfirmed(ArrayList(icons.map { (it as io.openmobilemaps.mapscore.shared.map.layers.icon.IconInfoInterface).asKmp() })) + return result + } + + override fun onLongPress(icons: ArrayList): Boolean { + val result = delegate.onLongPress(ArrayList(icons.map { (it as io.openmobilemaps.mapscore.shared.map.layers.icon.IconInfoInterface).asKmp() })) + return result + } +} + +internal fun KMIconLayerCallbackInterface.asPlatform(): IconLayerCallbackInterface = when (this) { + is KMIconLayerCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMIconLayerCallbackInterfacePlatformProxy(this) +} +public fun IconLayerCallbackInterface.asKmp(): KMIconLayerCallbackInterface = KMIconLayerCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerInterface.kt new file mode 100644 index 000000000..b8a98bf75 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerInterface.kt @@ -0,0 +1,87 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.icon.IconLayerInterface + +actual class KMIconLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as IconLayerInterface + + actual fun setIcons(icons: ArrayList) { + native.setIcons(ArrayList(icons.map { it.asPlatform() })) + } + + actual fun getIcons(): ArrayList { + val result = native.getIcons() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.layers.icon.IconInfoInterface).asKmp() }) + } + + actual fun remove(icon: KMIconInfoInterface) { + native.remove(icon.asPlatform()) + } + + actual fun removeList(icons: ArrayList) { + native.removeList(ArrayList(icons.map { it.asPlatform() })) + } + + actual fun removeIdentifier(identifier: String) { + native.removeIdentifier(identifier) + } + + actual fun removeIdentifierList(identifiers: ArrayList) { + native.removeIdentifierList(ArrayList(identifiers.map { it })) + } + + actual fun add(icon: KMIconInfoInterface) { + native.add(icon.asPlatform()) + } + + actual fun addList(icons: ArrayList) { + native.addList(ArrayList(icons.map { it.asPlatform() })) + } + + actual fun clear() { + native.clear() + } + + actual fun setCallbackHandler(handler: KMIconLayerCallbackInterface) { + native.setCallbackHandler(handler.asPlatform()) + } + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as io.openmobilemaps.mapscore.shared.map.LayerInterface).asKmp() + } + + actual fun invalidate() { + native.invalidate() + } + + actual fun setLayerClickable(isLayerClickable: Boolean) { + native.setLayerClickable(isLayerClickable) + } + + actual fun setRenderPassIndex(index: Int) { + native.setRenderPassIndex(index) + } + + actual fun animateIconScale(identifier: String, from: Float, to: Float, duration: Float, repetitions: Int) { + native.animateIconScale(identifier, from, to, duration, repetitions) + } + + actual companion object + { + + actual fun create(): KMIconLayerInterface { + val result = IconLayerInterface.create() + return (result as io.openmobilemaps.mapscore.shared.map.layers.icon.IconLayerInterface).asKmp() + } + } +} + +internal fun KMIconLayerInterface.asPlatform(): IconLayerInterface = nativeHandle as IconLayerInterface +public fun IconLayerInterface.asKmp(): KMIconLayerInterface = KMIconLayerInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconTextFit.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconTextFit.kt new file mode 100644 index 000000000..14779c16e --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconTextFit.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMIconTextFit = io.openmobilemaps.mapscore.shared.map.layers.text.IconTextFit + +internal fun KMIconTextFit.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.text.IconTextFit = this +public fun io.openmobilemaps.mapscore.shared.map.layers.text.IconTextFit.asKmp(): KMIconTextFit = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconType.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconType.kt new file mode 100644 index 000000000..dbc408042 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconType.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMIconType = io.openmobilemaps.mapscore.shared.map.layers.icon.IconType + +internal fun KMIconType.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.icon.IconType = this +public fun io.openmobilemaps.mapscore.shared.map.layers.icon.IconType.asKmp(): KMIconType = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronInterface.kt new file mode 100644 index 000000000..f649d7524 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronInterface.kt @@ -0,0 +1,46 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.IcosahedronInterface + +actual interface KMIcosahedronInterface +{ + + actual fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) + + actual fun asGraphicsObject(): KMGraphicsObjectInterface +} + +private class KMIcosahedronInterfacePlatformWrapper(internal val nativeHandle: IcosahedronInterface) : KMIcosahedronInterface +{ + + override fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) { + nativeHandle.setVertices(vertices.asPlatform(), indices.asPlatform(), origin.asPlatform()) + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface).asKmp() + } +} + +private class KMIcosahedronInterfacePlatformProxy(private val delegate: KMIcosahedronInterface) : IcosahedronInterface() +{ + + override fun setVertices(vertices: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes, indices: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D) { + delegate.setVertices((vertices as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp(), (indices as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp(), (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp()) + } + + override fun asGraphicsObject(): io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } +} + +internal fun KMIcosahedronInterface.asPlatform(): IcosahedronInterface = when (this) { + is KMIcosahedronInterfacePlatformWrapper -> this.nativeHandle + else -> KMIcosahedronInterfacePlatformProxy(this) +} +public fun IcosahedronInterface.asKmp(): KMIcosahedronInterface = KMIcosahedronInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerCallbackInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerCallbackInterface.kt new file mode 100644 index 000000000..8f954ccf0 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerCallbackInterface.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icosahedron.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.icosahedron.IcosahedronLayerCallbackInterface + +actual interface KMIcosahedronLayerCallbackInterface +{ + + actual fun getData(): KMFuture +} + +private class KMIcosahedronLayerCallbackInterfacePlatformWrapper(internal val nativeHandle: IcosahedronLayerCallbackInterface) : KMIcosahedronLayerCallbackInterface +{ + + override fun getData(): KMFuture { + val result = nativeHandle.getData() + return (result as com.snapchat.djinni.Future).asKmp() + } +} + +private class KMIcosahedronLayerCallbackInterfacePlatformProxy(private val delegate: KMIcosahedronLayerCallbackInterface) : IcosahedronLayerCallbackInterface() +{ + + override fun getData(): com.snapchat.djinni.Future { + val result = delegate.getData() + return result.asPlatform() + } +} + +internal fun KMIcosahedronLayerCallbackInterface.asPlatform(): IcosahedronLayerCallbackInterface = when (this) { + is KMIcosahedronLayerCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMIcosahedronLayerCallbackInterfacePlatformProxy(this) +} +public fun IcosahedronLayerCallbackInterface.asKmp(): KMIcosahedronLayerCallbackInterface = KMIcosahedronLayerCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerInterface.kt new file mode 100644 index 000000000..babfd2d40 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerInterface.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icosahedron.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.icosahedron.IcosahedronLayerInterface + +actual class KMIcosahedronLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as IcosahedronLayerInterface + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as io.openmobilemaps.mapscore.shared.map.LayerInterface).asKmp() + } + + actual companion object + { + + actual fun create(callbackHandler: KMIcosahedronLayerCallbackInterface): KMIcosahedronLayerInterface { + val result = IcosahedronLayerInterface.create(callbackHandler.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.layers.icosahedron.IcosahedronLayerInterface).asKmp() + } + } +} + +internal fun KMIcosahedronLayerInterface.asPlatform(): IcosahedronLayerInterface = nativeHandle as IcosahedronLayerInterface +public fun IcosahedronLayerInterface.asKmp(): KMIcosahedronLayerInterface = KMIcosahedronLayerInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIndexedLayerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIndexedLayerInterface.kt new file mode 100644 index 000000000..e36038eeb --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIndexedLayerInterface.kt @@ -0,0 +1,48 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.IndexedLayerInterface + +actual interface KMIndexedLayerInterface +{ + + actual fun getLayerInterface(): KMLayerInterface + + actual fun getIndex(): Int +} + +private class KMIndexedLayerInterfacePlatformWrapper(internal val nativeHandle: IndexedLayerInterface) : KMIndexedLayerInterface +{ + + override fun getLayerInterface(): KMLayerInterface { + val result = nativeHandle.getLayerInterface() + return (result as io.openmobilemaps.mapscore.shared.map.LayerInterface).asKmp() + } + + override fun getIndex(): Int { + val result = nativeHandle.getIndex() + return result + } +} + +private class KMIndexedLayerInterfacePlatformProxy(private val delegate: KMIndexedLayerInterface) : IndexedLayerInterface() +{ + + override fun getLayerInterface(): io.openmobilemaps.mapscore.shared.map.LayerInterface { + val result = delegate.getLayerInterface() + return result.asPlatform() + } + + override fun getIndex(): Int { + val result = delegate.getIndex() + return result + } +} + +internal fun KMIndexedLayerInterface.asPlatform(): IndexedLayerInterface = when (this) { + is KMIndexedLayerInterfacePlatformWrapper -> this.nativeHandle + else -> KMIndexedLayerInterfacePlatformProxy(this) +} +public fun IndexedLayerInterface.asKmp(): KMIndexedLayerInterface = KMIndexedLayerInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerInterface.kt new file mode 100644 index 000000000..62a4b3299 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerInterface.kt @@ -0,0 +1,212 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.LayerInterface + +actual interface KMLayerInterface +{ + + actual fun setMaskingObject(maskingObject: KMMaskingObjectInterface?) + + actual fun update() + + actual fun buildRenderPasses(): ArrayList + + actual fun buildComputePasses(): ArrayList + + actual fun onAdded(mapInterface: KMMapInterface, layerIndex: Int) + + actual fun onRemoved() + + actual fun pause() + + actual fun resume() + + actual fun hide() + + actual fun show() + + actual fun setAlpha(alpha: Float) + + actual fun getAlpha(): Float + + actual fun setScissorRect(scissorRect: KMRectI?) + + actual fun isReadyToRenderOffscreen(): KMLayerReadyState + + actual fun enableAnimations(enabled: Boolean) + + actual fun setErrorManager(errorManager: KMErrorManager) + + actual fun forceReload() + + actual fun setPrimaryRenderTarget(target: KMRenderTargetInterface?) +} + +private class KMLayerInterfacePlatformWrapper(internal val nativeHandle: LayerInterface) : KMLayerInterface +{ + + override fun setMaskingObject(maskingObject: KMMaskingObjectInterface?) { + nativeHandle.setMaskingObject(maskingObject?.let { it.asPlatform() }) + } + + override fun update() { + nativeHandle.update() + } + + override fun buildRenderPasses(): ArrayList { + val result = nativeHandle.buildRenderPasses() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.graphics.RenderPassInterface).asKmp() }) + } + + override fun buildComputePasses(): ArrayList { + val result = nativeHandle.buildComputePasses() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.graphics.ComputePassInterface).asKmp() }) + } + + override fun onAdded(mapInterface: KMMapInterface, layerIndex: Int) { + nativeHandle.onAdded(mapInterface.asPlatform(), layerIndex) + } + + override fun onRemoved() { + nativeHandle.onRemoved() + } + + override fun pause() { + nativeHandle.pause() + } + + override fun resume() { + nativeHandle.resume() + } + + override fun hide() { + nativeHandle.hide() + } + + override fun show() { + nativeHandle.show() + } + + override fun setAlpha(alpha: Float) { + nativeHandle.setAlpha(alpha) + } + + override fun getAlpha(): Float { + val result = nativeHandle.getAlpha() + return result + } + + override fun setScissorRect(scissorRect: KMRectI?) { + nativeHandle.setScissorRect(scissorRect?.let { it.asPlatform() }) + } + + override fun isReadyToRenderOffscreen(): KMLayerReadyState { + val result = nativeHandle.isReadyToRenderOffscreen() + return (result as io.openmobilemaps.mapscore.shared.map.LayerReadyState).asKmp() + } + + override fun enableAnimations(enabled: Boolean) { + nativeHandle.enableAnimations(enabled) + } + + override fun setErrorManager(errorManager: KMErrorManager) { + nativeHandle.setErrorManager(errorManager.asPlatform()) + } + + override fun forceReload() { + nativeHandle.forceReload() + } + + override fun setPrimaryRenderTarget(target: KMRenderTargetInterface?) { + nativeHandle.setPrimaryRenderTarget(target?.let { it.asPlatform() }) + } +} + +private class KMLayerInterfacePlatformProxy(private val delegate: KMLayerInterface) : LayerInterface() +{ + + override fun setMaskingObject(maskingObject: io.openmobilemaps.mapscore.shared.graphics.objects.MaskingObjectInterface?) { + delegate.setMaskingObject(maskingObject?.let { (it as io.openmobilemaps.mapscore.shared.graphics.objects.MaskingObjectInterface).asKmp() }) + } + + override fun update() { + delegate.update() + } + + override fun buildRenderPasses(): ArrayList { + val result = delegate.buildRenderPasses() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun buildComputePasses(): ArrayList { + val result = delegate.buildComputePasses() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun onAdded(mapInterface: io.openmobilemaps.mapscore.shared.map.MapInterface, layerIndex: Int) { + delegate.onAdded((mapInterface as io.openmobilemaps.mapscore.shared.map.MapInterface).asKmp(), layerIndex) + } + + override fun onRemoved() { + delegate.onRemoved() + } + + override fun pause() { + delegate.pause() + } + + override fun resume() { + delegate.resume() + } + + override fun hide() { + delegate.hide() + } + + override fun show() { + delegate.show() + } + + override fun setAlpha(alpha: Float) { + delegate.setAlpha(alpha) + } + + override fun getAlpha(): Float { + val result = delegate.getAlpha() + return result + } + + override fun setScissorRect(scissorRect: io.openmobilemaps.mapscore.shared.graphics.common.RectI?) { + delegate.setScissorRect(scissorRect?.let { (it as io.openmobilemaps.mapscore.shared.graphics.common.RectI).asKmp() }) + } + + override fun isReadyToRenderOffscreen(): io.openmobilemaps.mapscore.shared.map.LayerReadyState { + val result = delegate.isReadyToRenderOffscreen() + return result.asPlatform() + } + + override fun enableAnimations(enabled: Boolean) { + delegate.enableAnimations(enabled) + } + + override fun setErrorManager(errorManager: io.openmobilemaps.mapscore.shared.map.ErrorManager) { + delegate.setErrorManager((errorManager as io.openmobilemaps.mapscore.shared.map.ErrorManager).asKmp()) + } + + override fun forceReload() { + delegate.forceReload() + } + + override fun setPrimaryRenderTarget(target: io.openmobilemaps.mapscore.shared.graphics.RenderTargetInterface?) { + delegate.setPrimaryRenderTarget(target?.let { (it as io.openmobilemaps.mapscore.shared.graphics.RenderTargetInterface).asKmp() }) + } +} + +internal fun KMLayerInterface.asPlatform(): LayerInterface = when (this) { + is KMLayerInterfacePlatformWrapper -> this.nativeHandle + else -> KMLayerInterfacePlatformProxy(this) +} +public fun LayerInterface.asKmp(): KMLayerInterface = KMLayerInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerObjectInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerObjectInterface.kt new file mode 100644 index 000000000..a152aaa03 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerObjectInterface.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from layer_object.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.objects.LayerObjectInterface + +actual class KMLayerObjectInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as LayerObjectInterface + + actual fun update() { + native.update() + } + + actual fun getRenderConfig(): ArrayList { + val result = native.getRenderConfig() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.layers.objects.RenderConfigInterface).asKmp() }) + } +} + +internal fun KMLayerObjectInterface.asPlatform(): LayerObjectInterface = nativeHandle as LayerObjectInterface +public fun LayerObjectInterface.asKmp(): KMLayerObjectInterface = KMLayerObjectInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerReadyState.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerReadyState.kt new file mode 100644 index 000000000..99f5210c2 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerReadyState.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMLayerReadyState = io.openmobilemaps.mapscore.shared.map.LayerReadyState + +internal fun KMLayerReadyState.asPlatform(): io.openmobilemaps.mapscore.shared.map.LayerReadyState = this +public fun io.openmobilemaps.mapscore.shared.map.LayerReadyState.asKmp(): KMLayerReadyState = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineCapType.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineCapType.kt new file mode 100644 index 000000000..f3d758125 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineCapType.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMLineCapType = io.openmobilemaps.mapscore.shared.map.layers.line.LineCapType + +internal fun KMLineCapType.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.line.LineCapType = this +public fun io.openmobilemaps.mapscore.shared.map.layers.line.LineCapType.asKmp(): KMLineCapType = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineFactory.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineFactory.kt new file mode 100644 index 000000000..beb41468f --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineFactory.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.line.LineFactory + +actual class KMLineFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as LineFactory + + actual companion object + { + + actual fun createLine(identifier: String, coordinates: ArrayList, style: KMLineStyle): KMLineInfoInterface { + val result = LineFactory.createLine(identifier, ArrayList(coordinates.map { it.asPlatform() }), style.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.layers.line.LineInfoInterface).asKmp() + } + } +} + +internal fun KMLineFactory.asPlatform(): LineFactory = nativeHandle as LineFactory +public fun LineFactory.asKmp(): KMLineFactory = KMLineFactory(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroup2dInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroup2dInterface.kt new file mode 100644 index 000000000..9c7dd509e --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroup2dInterface.kt @@ -0,0 +1,46 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.LineGroup2dInterface + +actual interface KMLineGroup2dInterface +{ + + actual fun setLines(lines: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D, is3d: Boolean) + + actual fun asGraphicsObject(): KMGraphicsObjectInterface +} + +private class KMLineGroup2dInterfacePlatformWrapper(internal val nativeHandle: LineGroup2dInterface) : KMLineGroup2dInterface +{ + + override fun setLines(lines: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D, is3d: Boolean) { + nativeHandle.setLines(lines.asPlatform(), indices.asPlatform(), origin.asPlatform(), is3d) + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface).asKmp() + } +} + +private class KMLineGroup2dInterfacePlatformProxy(private val delegate: KMLineGroup2dInterface) : LineGroup2dInterface() +{ + + override fun setLines(lines: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes, indices: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D, is3d: Boolean) { + delegate.setLines((lines as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp(), (indices as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp(), (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp(), is3d) + } + + override fun asGraphicsObject(): io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } +} + +internal fun KMLineGroup2dInterface.asPlatform(): LineGroup2dInterface = when (this) { + is KMLineGroup2dInterfacePlatformWrapper -> this.nativeHandle + else -> KMLineGroup2dInterfacePlatformProxy(this) +} +public fun LineGroup2dInterface.asKmp(): KMLineGroup2dInterface = KMLineGroup2dInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroupShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroupShaderInterface.kt new file mode 100644 index 000000000..17ff62427 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroupShaderInterface.kt @@ -0,0 +1,29 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.LineGroupShaderInterface + +actual class KMLineGroupShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as LineGroupShaderInterface + + actual fun setStyles(styles: KMSharedBytes) { + native.setStyles(styles.asPlatform()) + } + + actual fun setDashingScaleFactor(factor: Float) { + native.setDashingScaleFactor(factor) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } +} + +internal fun KMLineGroupShaderInterface.asPlatform(): LineGroupShaderInterface = nativeHandle as LineGroupShaderInterface +public fun LineGroupShaderInterface.asKmp(): KMLineGroupShaderInterface = KMLineGroupShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineInfoInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineInfoInterface.kt new file mode 100644 index 000000000..ae2324977 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineInfoInterface.kt @@ -0,0 +1,31 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.line.LineInfoInterface + +actual class KMLineInfoInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as LineInfoInterface + + actual fun getIdentifier(): String { + val result = native.getIdentifier() + return result + } + + actual fun getCoordinates(): ArrayList { + val result = native.getCoordinates() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp() }) + } + + actual fun getStyle(): KMLineStyle { + val result = native.getStyle() + return (result as io.openmobilemaps.mapscore.shared.map.layers.line.LineStyle).asKmp() + } +} + +internal fun KMLineInfoInterface.asPlatform(): LineInfoInterface = nativeHandle as LineInfoInterface +public fun LineInfoInterface.asKmp(): KMLineInfoInterface = KMLineInfoInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineJoinType.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineJoinType.kt new file mode 100644 index 000000000..23746788d --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineJoinType.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMLineJoinType = io.openmobilemaps.mapscore.shared.map.layers.line.LineJoinType + +internal fun KMLineJoinType.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.line.LineJoinType = this +public fun io.openmobilemaps.mapscore.shared.map.layers.line.LineJoinType.asKmp(): KMLineJoinType = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerCallbackInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerCallbackInterface.kt new file mode 100644 index 000000000..165c6321a --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerCallbackInterface.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.line.LineLayerCallbackInterface + +actual interface KMLineLayerCallbackInterface +{ + + actual fun onLineClickConfirmed(line: KMLineInfoInterface) +} + +private class KMLineLayerCallbackInterfacePlatformWrapper(internal val nativeHandle: LineLayerCallbackInterface) : KMLineLayerCallbackInterface +{ + + override fun onLineClickConfirmed(line: KMLineInfoInterface) { + nativeHandle.onLineClickConfirmed(line.asPlatform()) + } +} + +private class KMLineLayerCallbackInterfacePlatformProxy(private val delegate: KMLineLayerCallbackInterface) : LineLayerCallbackInterface() +{ + + override fun onLineClickConfirmed(line: io.openmobilemaps.mapscore.shared.map.layers.line.LineInfoInterface) { + delegate.onLineClickConfirmed((line as io.openmobilemaps.mapscore.shared.map.layers.line.LineInfoInterface).asKmp()) + } +} + +internal fun KMLineLayerCallbackInterface.asPlatform(): LineLayerCallbackInterface = when (this) { + is KMLineLayerCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMLineLayerCallbackInterfacePlatformProxy(this) +} +public fun LineLayerCallbackInterface.asKmp(): KMLineLayerCallbackInterface = KMLineLayerCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerInterface.kt new file mode 100644 index 000000000..041a805ee --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerInterface.kt @@ -0,0 +1,75 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.line.LineLayerInterface + +actual class KMLineLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as LineLayerInterface + + actual fun setLines(lines: ArrayList) { + native.setLines(ArrayList(lines.map { it.asPlatform() })) + } + + actual fun getLines(): ArrayList { + val result = native.getLines() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.layers.line.LineInfoInterface).asKmp() }) + } + + actual fun remove(line: KMLineInfoInterface) { + native.remove(line.asPlatform()) + } + + actual fun add(line: KMLineInfoInterface) { + native.add(line.asPlatform()) + } + + actual fun clear() { + native.clear() + } + + actual fun setCallbackHandler(handler: KMLineLayerCallbackInterface) { + native.setCallbackHandler(handler.asPlatform()) + } + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as io.openmobilemaps.mapscore.shared.map.LayerInterface).asKmp() + } + + actual fun invalidate() { + native.invalidate() + } + + actual fun resetSelection() { + native.resetSelection() + } + + actual fun setSelected(selectedIds: HashSet) { + native.setSelected(HashSet(selectedIds.map { it })) + } + + actual fun setLayerClickable(isLayerClickable: Boolean) { + native.setLayerClickable(isLayerClickable) + } + + actual fun setRenderPassIndex(index: Int) { + native.setRenderPassIndex(index) + } + + actual companion object + { + + actual fun create(): KMLineLayerInterface { + val result = LineLayerInterface.create() + return (result as io.openmobilemaps.mapscore.shared.map.layers.line.LineLayerInterface).asKmp() + } + } +} + +internal fun KMLineLayerInterface.asPlatform(): LineLayerInterface = nativeHandle as LineLayerInterface +public fun LineLayerInterface.asKmp(): KMLineLayerInterface = KMLineLayerInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineStyle.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineStyle.kt new file mode 100644 index 000000000..4cc2e4ef9 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineStyle.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMLineStyle = io.openmobilemaps.mapscore.shared.map.layers.line.LineStyle + +internal fun KMLineStyle.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.line.LineStyle = this +public fun io.openmobilemaps.mapscore.shared.map.layers.line.LineStyle.asKmp(): KMLineStyle = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderInterface.kt new file mode 100644 index 000000000..ebdd939ae --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderInterface.kt @@ -0,0 +1,82 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.loader.LoaderInterface + +actual interface KMLoaderInterface +{ + + actual fun loadTexture(url: String, etag: String?): KMTextureLoaderResult + + actual fun loadData(url: String, etag: String?): KMDataLoaderResult + + actual fun loadTextureAsync(url: String, etag: String?): KMFuture + + actual fun loadDataAsync(url: String, etag: String?): KMFuture + + actual fun cancel(url: String) +} + +private class KMLoaderInterfacePlatformWrapper(internal val nativeHandle: LoaderInterface) : KMLoaderInterface +{ + + override fun loadTexture(url: String, etag: String?): KMTextureLoaderResult { + val result = nativeHandle.loadTexture(url, etag?.let { it }) + return (result as io.openmobilemaps.mapscore.shared.map.loader.TextureLoaderResult).asKmp() + } + + override fun loadData(url: String, etag: String?): KMDataLoaderResult { + val result = nativeHandle.loadData(url, etag?.let { it }) + return (result as io.openmobilemaps.mapscore.shared.map.loader.DataLoaderResult).asKmp() + } + + override fun loadTextureAsync(url: String, etag: String?): KMFuture { + val result = nativeHandle.loadTextureAsync(url, etag?.let { it }) + return (result as com.snapchat.djinni.Future).asKmp() + } + + override fun loadDataAsync(url: String, etag: String?): KMFuture { + val result = nativeHandle.loadDataAsync(url, etag?.let { it }) + return (result as com.snapchat.djinni.Future).asKmp() + } + + override fun cancel(url: String) { + nativeHandle.cancel(url) + } +} + +private class KMLoaderInterfacePlatformProxy(private val delegate: KMLoaderInterface) : LoaderInterface() +{ + + override fun loadTexture(url: String, etag: String?): io.openmobilemaps.mapscore.shared.map.loader.TextureLoaderResult { + val result = delegate.loadTexture(url, etag?.let { it }) + return result.asPlatform() + } + + override fun loadData(url: String, etag: String?): io.openmobilemaps.mapscore.shared.map.loader.DataLoaderResult { + val result = delegate.loadData(url, etag?.let { it }) + return result.asPlatform() + } + + override fun loadTextureAsync(url: String, etag: String?): com.snapchat.djinni.Future { + val result = delegate.loadTextureAsync(url, etag?.let { it }) + return result.asPlatform() + } + + override fun loadDataAsync(url: String, etag: String?): com.snapchat.djinni.Future { + val result = delegate.loadDataAsync(url, etag?.let { it }) + return result.asPlatform() + } + + override fun cancel(url: String) { + delegate.cancel(url) + } +} + +internal fun KMLoaderInterface.asPlatform(): LoaderInterface = when (this) { + is KMLoaderInterfacePlatformWrapper -> this.nativeHandle + else -> KMLoaderInterfacePlatformProxy(this) +} +public fun LoaderInterface.asKmp(): KMLoaderInterface = KMLoaderInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderStatus.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderStatus.kt new file mode 100644 index 000000000..bbabdea08 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderStatus.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMLoaderStatus = io.openmobilemaps.mapscore.shared.map.loader.LoaderStatus + +internal fun KMLoaderStatus.asPlatform(): io.openmobilemaps.mapscore.shared.map.loader.LoaderStatus = this +public fun io.openmobilemaps.mapscore.shared.map.loader.LoaderStatus.asKmp(): KMLoaderStatus = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoggerData.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoggerData.kt new file mode 100644 index 000000000..26c67c560 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoggerData.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMLoggerData = io.openmobilemaps.mapscore.shared.map.LoggerData + +internal fun KMLoggerData.asPlatform(): io.openmobilemaps.mapscore.shared.map.LoggerData = this +public fun io.openmobilemaps.mapscore.shared.map.LoggerData.asKmp(): KMLoggerData = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCallbackInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCallbackInterface.kt new file mode 100644 index 000000000..56851ca99 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCallbackInterface.kt @@ -0,0 +1,44 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.MapCallbackInterface + +actual interface KMMapCallbackInterface +{ + + actual fun invalidate() + + actual fun onMapResumed() +} + +private class KMMapCallbackInterfacePlatformWrapper(internal val nativeHandle: MapCallbackInterface) : KMMapCallbackInterface +{ + + override fun invalidate() { + nativeHandle.invalidate() + } + + override fun onMapResumed() { + nativeHandle.onMapResumed() + } +} + +private class KMMapCallbackInterfacePlatformProxy(private val delegate: KMMapCallbackInterface) : MapCallbackInterface() +{ + + override fun invalidate() { + delegate.invalidate() + } + + override fun onMapResumed() { + delegate.onMapResumed() + } +} + +internal fun KMMapCallbackInterface.asPlatform(): MapCallbackInterface = when (this) { + is KMMapCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMMapCallbackInterfacePlatformProxy(this) +} +public fun MapCallbackInterface.asKmp(): KMMapCallbackInterface = KMMapCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCamera3dInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCamera3dInterface.kt new file mode 100644 index 000000000..4564792c1 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCamera3dInterface.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.MapCamera3dInterface + +actual class KMMapCamera3dInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCamera3dInterface + + actual fun getCameraConfig(): KMCamera3dConfig { + val result = native.getCameraConfig() + return (result as io.openmobilemaps.mapscore.shared.map.Camera3dConfig).asKmp() + } + + actual fun setCameraConfig(config: KMCamera3dConfig, durationSeconds: Float?, targetZoom: Float?, targetCoordinate: KMCoord?) { + native.setCameraConfig(config.asPlatform(), durationSeconds?.let { it }, targetZoom?.let { it }, targetCoordinate?.let { it.asPlatform() }) + } +} + +internal fun KMMapCamera3dInterface.asPlatform(): MapCamera3dInterface = nativeHandle as MapCamera3dInterface +public fun MapCamera3dInterface.asKmp(): KMMapCamera3dInterface = KMMapCamera3dInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraInterface.kt new file mode 100644 index 000000000..025fcc3a0 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraInterface.kt @@ -0,0 +1,240 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.MapCameraInterface + +actual class KMMapCameraInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCameraInterface + + actual fun freeze(freeze: Boolean) { + native.freeze(freeze) + } + + actual fun moveToCenterPositionZoom(centerPosition: KMCoord, zoom: Double, animated: Boolean) { + native.moveToCenterPositionZoom(centerPosition.asPlatform(), zoom, animated) + } + + actual fun moveToCenterPosition(centerPosition: KMCoord, animated: Boolean) { + native.moveToCenterPosition(centerPosition.asPlatform(), animated) + } + + actual fun moveToBoundingBox(boundingBox: KMRectCoord, paddingPc: Float, animated: Boolean, minZoom: Double?, maxZoom: Double?) { + native.moveToBoundingBox(boundingBox.asPlatform(), paddingPc, animated, minZoom?.let { it }, maxZoom?.let { it }) + } + + actual fun getCenterPosition(): KMCoord { + val result = native.getCenterPosition() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp() + } + + actual fun setZoom(zoom: Double, animated: Boolean) { + native.setZoom(zoom, animated) + } + + actual fun getZoom(): Double { + val result = native.getZoom() + return result + } + + actual fun setRotation(angle: Float, animated: Boolean) { + native.setRotation(angle, animated) + } + + actual fun getRotation(): Float { + val result = native.getRotation() + return result + } + + actual fun setMinZoom(minZoom: Double) { + native.setMinZoom(minZoom) + } + + actual fun setMaxZoom(maxZoom: Double) { + native.setMaxZoom(maxZoom) + } + + actual fun getMinZoom(): Double { + val result = native.getMinZoom() + return result + } + + actual fun getMaxZoom(): Double { + val result = native.getMaxZoom() + return result + } + + actual fun setBounds(bounds: KMRectCoord) { + native.setBounds(bounds.asPlatform()) + } + + actual fun getBounds(): KMRectCoord { + val result = native.getBounds() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord).asKmp() + } + + actual fun isInBounds(coords: KMCoord): Boolean { + val result = native.isInBounds(coords.asPlatform()) + return result + } + + actual fun setPaddingLeft(padding: Float) { + native.setPaddingLeft(padding) + } + + actual fun setPaddingRight(padding: Float) { + native.setPaddingRight(padding) + } + + actual fun setPaddingTop(padding: Float) { + native.setPaddingTop(padding) + } + + actual fun setPaddingBottom(padding: Float) { + native.setPaddingBottom(padding) + } + + actual fun getVisibleRect(): KMRectCoord { + val result = native.getVisibleRect() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord).asKmp() + } + + actual fun getPaddingAdjustedVisibleRect(): KMRectCoord { + val result = native.getPaddingAdjustedVisibleRect() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord).asKmp() + } + + actual fun getScreenDensityPpi(): Float { + val result = native.getScreenDensityPpi() + return result + } + + actual fun update() { + native.update() + } + + actual fun getInvariantModelMatrix(coordinate: KMCoord, scaleInvariant: Boolean, rotationInvariant: Boolean): ArrayList { + val result = native.getInvariantModelMatrix(coordinate.asPlatform(), scaleInvariant, rotationInvariant) + return ArrayList(result.map { it }) + } + + actual fun addListener(listener: KMMapCameraListenerInterface) { + native.addListener(listener.asPlatform()) + } + + actual fun removeListener(listener: KMMapCameraListenerInterface) { + native.removeListener(listener.asPlatform()) + } + + actual fun notifyListenerBoundsChange() { + native.notifyListenerBoundsChange() + } + + actual fun coordFromScreenPosition(posScreen: KMVec2F): KMCoord { + val result = native.coordFromScreenPosition(posScreen.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp() + } + + actual fun coordFromScreenPositionZoom(posScreen: KMVec2F, zoom: Float): KMCoord { + val result = native.coordFromScreenPositionZoom(posScreen.asPlatform(), zoom) + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp() + } + + actual fun screenPosFromCoord(coord: KMCoord): KMVec2F { + val result = native.screenPosFromCoord(coord.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp() + } + + actual fun screenPosFromCoordZoom(coord: KMCoord, zoom: Float): KMVec2F { + val result = native.screenPosFromCoordZoom(coord.asPlatform(), zoom) + return (result as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp() + } + + actual fun mapUnitsFromPixels(distancePx: Double): Double { + val result = native.mapUnitsFromPixels(distancePx) + return result + } + + actual fun getScalingFactor(): Double { + val result = native.getScalingFactor() + return result + } + + actual fun coordIsVisibleOnScreen(coord: KMCoord, paddingPc: Float): Boolean { + val result = native.coordIsVisibleOnScreen(coord.asPlatform(), paddingPc) + return result + } + + actual fun setRotationEnabled(enabled: Boolean) { + native.setRotationEnabled(enabled) + } + + actual fun setSnapToNorthEnabled(enabled: Boolean) { + native.setSnapToNorthEnabled(enabled) + } + + actual fun setBoundsRestrictWholeVisibleRect(enabled: Boolean) { + native.setBoundsRestrictWholeVisibleRect(enabled) + } + + actual fun asCameraInterface(): KMCameraInterface { + val result = native.asCameraInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.CameraInterface).asKmp() + } + + actual fun getLastVpMatrixD(): ArrayList? { + val result = native.getLastVpMatrixD() + return result?.let { ArrayList(it.map { it }) } + } + + actual fun getLastVpMatrix(): ArrayList? { + val result = native.getLastVpMatrix() + return result?.let { ArrayList(it.map { it }) } + } + + actual fun getLastInverseVpMatrix(): ArrayList? { + val result = native.getLastInverseVpMatrix() + return result?.let { ArrayList(it.map { it }) } + } + + actual fun getLastVpMatrixViewBounds(): KMRectCoord? { + val result = native.getLastVpMatrixViewBounds() + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord).asKmp() } + } + + actual fun getLastVpMatrixRotation(): Float? { + val result = native.getLastVpMatrixRotation() + return result?.let { it } + } + + actual fun getLastVpMatrixZoom(): Float? { + val result = native.getLastVpMatrixZoom() + return result?.let { it } + } + + actual fun getLastCameraPosition(): KMVec3D? { + val result = native.getLastCameraPosition() + return result?.let { (it as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp() } + } + + actual fun asMapCamera3d(): KMMapCamera3dInterface? { + val result = native.asMapCamera3d() + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.MapCamera3dInterface).asKmp() } + } + + actual companion object + { + + actual fun create(mapInterface: KMMapInterface, screenDensityPpi: Float, is3D: Boolean): KMMapCameraInterface { + val result = MapCameraInterface.create(mapInterface.asPlatform(), screenDensityPpi, is3D) + return (result as io.openmobilemaps.mapscore.shared.map.MapCameraInterface).asKmp() + } + } +} + +internal fun KMMapCameraInterface.asPlatform(): MapCameraInterface = nativeHandle as MapCameraInterface +public fun MapCameraInterface.asKmp(): KMMapCameraInterface = KMMapCameraInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraListenerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraListenerInterface.kt new file mode 100644 index 000000000..18138c6a9 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraListenerInterface.kt @@ -0,0 +1,64 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from camera.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.camera.MapCameraListenerInterface + +actual interface KMMapCameraListenerInterface +{ + + actual fun onVisibleBoundsChanged(visibleBounds: KMRectCoord, zoom: Double) + + actual fun onRotationChanged(angle: Float) + + actual fun onMapInteraction() + + actual fun onCameraChange(viewMatrix: ArrayList, projectionMatrix: ArrayList, origin: KMVec3D, verticalFov: Float, horizontalFov: Float, width: Float, height: Float, focusPointAltitude: Float, focusPointPosition: KMCoord, zoom: Float) +} + +private class KMMapCameraListenerInterfacePlatformWrapper(internal val nativeHandle: MapCameraListenerInterface) : KMMapCameraListenerInterface +{ + + override fun onVisibleBoundsChanged(visibleBounds: KMRectCoord, zoom: Double) { + nativeHandle.onVisibleBoundsChanged(visibleBounds.asPlatform(), zoom) + } + + override fun onRotationChanged(angle: Float) { + nativeHandle.onRotationChanged(angle) + } + + override fun onMapInteraction() { + nativeHandle.onMapInteraction() + } + + override fun onCameraChange(viewMatrix: ArrayList, projectionMatrix: ArrayList, origin: KMVec3D, verticalFov: Float, horizontalFov: Float, width: Float, height: Float, focusPointAltitude: Float, focusPointPosition: KMCoord, zoom: Float) { + nativeHandle.onCameraChange(ArrayList(viewMatrix.map { it }), ArrayList(projectionMatrix.map { it }), origin.asPlatform(), verticalFov, horizontalFov, width, height, focusPointAltitude, focusPointPosition.asPlatform(), zoom) + } +} + +private class KMMapCameraListenerInterfacePlatformProxy(private val delegate: KMMapCameraListenerInterface) : MapCameraListenerInterface() +{ + + override fun onVisibleBoundsChanged(visibleBounds: io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord, zoom: Double) { + delegate.onVisibleBoundsChanged((visibleBounds as io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord).asKmp(), zoom) + } + + override fun onRotationChanged(angle: Float) { + delegate.onRotationChanged(angle) + } + + override fun onMapInteraction() { + delegate.onMapInteraction() + } + + override fun onCameraChange(viewMatrix: ArrayList, projectionMatrix: ArrayList, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D, verticalFov: Float, horizontalFov: Float, width: Float, height: Float, focusPointAltitude: Float, focusPointPosition: io.openmobilemaps.mapscore.shared.map.coordinates.Coord, zoom: Float) { + delegate.onCameraChange(ArrayList(viewMatrix.map { it }), ArrayList(projectionMatrix.map { it }), (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp(), verticalFov, horizontalFov, width, height, focusPointAltitude, (focusPointPosition as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp(), zoom) + } +} + +internal fun KMMapCameraListenerInterface.asPlatform(): MapCameraListenerInterface = when (this) { + is KMMapCameraListenerInterfacePlatformWrapper -> this.nativeHandle + else -> KMMapCameraListenerInterfacePlatformProxy(this) +} +public fun MapCameraListenerInterface.asKmp(): KMMapCameraListenerInterface = KMMapCameraListenerInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapConfig.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapConfig.kt new file mode 100644 index 000000000..689c788c8 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapConfig.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMMapConfig = io.openmobilemaps.mapscore.shared.map.MapConfig + +internal fun KMMapConfig.asPlatform(): io.openmobilemaps.mapscore.shared.map.MapConfig = this +public fun io.openmobilemaps.mapscore.shared.map.MapConfig.asKmp(): KMMapConfig = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCoordinateSystem.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCoordinateSystem.kt new file mode 100644 index 000000000..4dc20046e --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCoordinateSystem.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMMapCoordinateSystem = io.openmobilemaps.mapscore.shared.map.coordinates.MapCoordinateSystem + +internal fun KMMapCoordinateSystem.asPlatform(): io.openmobilemaps.mapscore.shared.map.coordinates.MapCoordinateSystem = this +public fun io.openmobilemaps.mapscore.shared.map.coordinates.MapCoordinateSystem.asKmp(): KMMapCoordinateSystem = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterface.kt new file mode 100644 index 000000000..15fd1e961 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterface.kt @@ -0,0 +1,183 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.MapInterface + +actual class KMMapInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapInterface + + actual fun setCallbackHandler(callbackInterface: KMMapCallbackInterface?) { + native.setCallbackHandler(callbackInterface?.let { it.asPlatform() }) + } + + actual fun getGraphicsObjectFactory(): KMGraphicsObjectFactoryInterface { + val result = native.getGraphicsObjectFactory() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectFactoryInterface).asKmp() + } + + actual fun getShaderFactory(): KMShaderFactoryInterface { + val result = native.getShaderFactory() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderFactoryInterface).asKmp() + } + + actual fun getScheduler(): KMSchedulerInterface { + val result = native.getScheduler() + return (result as io.openmobilemaps.mapscore.shared.map.scheduling.SchedulerInterface).asKmp() + } + + actual fun getRenderingContext(): KMRenderingContextInterface { + val result = native.getRenderingContext() + return (result as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp() + } + + actual fun getMapConfig(): KMMapConfig { + val result = native.getMapConfig() + return (result as io.openmobilemaps.mapscore.shared.map.MapConfig).asKmp() + } + + actual fun getCoordinateConverterHelper(): KMCoordinateConversionHelperInterface { + val result = native.getCoordinateConverterHelper() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.CoordinateConversionHelperInterface).asKmp() + } + + actual fun setCamera(camera: KMMapCameraInterface) { + native.setCamera(camera.asPlatform()) + } + + actual fun getCamera(): KMMapCameraInterface { + val result = native.getCamera() + return (result as io.openmobilemaps.mapscore.shared.map.MapCameraInterface).asKmp() + } + + actual fun setTouchHandler(touchHandler: KMTouchHandlerInterface) { + native.setTouchHandler(touchHandler.asPlatform()) + } + + actual fun getTouchHandler(): KMTouchHandlerInterface { + val result = native.getTouchHandler() + return (result as io.openmobilemaps.mapscore.shared.map.controls.TouchHandlerInterface).asKmp() + } + + actual fun setPerformanceLoggers(performanceLoggers: ArrayList) { + native.setPerformanceLoggers(ArrayList(performanceLoggers.map { it.asPlatform() })) + } + + actual fun getPerformanceLoggers(): ArrayList { + val result = native.getPerformanceLoggers() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.PerformanceLoggerInterface).asKmp() }) + } + + actual fun getLayers(): ArrayList { + val result = native.getLayers() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.LayerInterface).asKmp() }) + } + + actual fun getLayersIndexed(): ArrayList { + val result = native.getLayersIndexed() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.IndexedLayerInterface).asKmp() }) + } + + actual fun addLayer(layer: KMLayerInterface) { + native.addLayer(layer.asPlatform()) + } + + actual fun insertLayerAt(layer: KMLayerInterface, atIndex: Int) { + native.insertLayerAt(layer.asPlatform(), atIndex) + } + + actual fun insertLayerAbove(layer: KMLayerInterface, above: KMLayerInterface) { + native.insertLayerAbove(layer.asPlatform(), above.asPlatform()) + } + + actual fun insertLayerBelow(layer: KMLayerInterface, below: KMLayerInterface) { + native.insertLayerBelow(layer.asPlatform(), below.asPlatform()) + } + + actual fun removeLayer(layer: KMLayerInterface) { + native.removeLayer(layer.asPlatform()) + } + + actual fun setViewportSize(size: KMVec2I) { + native.setViewportSize(size.asPlatform()) + } + + actual fun setBackgroundColor(color: KMColor) { + native.setBackgroundColor(color.asPlatform()) + } + + actual fun is3d(): Boolean { + val result = native.is3d() + return result + } + + actual fun invalidate() { + native.invalidate() + } + + actual fun resetIsInvalidated() { + native.resetIsInvalidated() + } + + actual fun prepare() { + native.prepare() + } + + actual fun getNeedsCompute(): Boolean { + val result = native.getNeedsCompute() + return result + } + + actual fun drawOffscreenFrame(target: KMRenderTargetInterface) { + native.drawOffscreenFrame(target.asPlatform()) + } + + actual fun drawFrame() { + native.drawFrame() + } + + actual fun compute() { + native.compute() + } + + actual fun resume() { + native.resume() + } + + actual fun pause() { + native.pause() + } + + actual fun destroy() { + native.destroy() + } + + actual fun drawReadyFrame(bounds: KMRectCoord, paddingPc: Float, timeout: Float, callbacks: KMMapReadyCallbackInterface) { + native.drawReadyFrame(bounds.asPlatform(), paddingPc, timeout, callbacks.asPlatform()) + } + + actual fun forceReload() { + native.forceReload() + } + + actual companion object + { + + actual fun create(graphicsFactory: KMGraphicsObjectFactoryInterface, shaderFactory: KMShaderFactoryInterface, renderingContext: KMRenderingContextInterface, mapConfig: KMMapConfig, scheduler: KMSchedulerInterface, pixelDensity: Float, is3D: Boolean): KMMapInterface { + val result = MapInterface.create(graphicsFactory.asPlatform(), shaderFactory.asPlatform(), renderingContext.asPlatform(), mapConfig.asPlatform(), scheduler.asPlatform(), pixelDensity, is3D) + return (result as io.openmobilemaps.mapscore.shared.map.MapInterface).asKmp() + } + + actual fun createWithOpenGl(mapConfig: KMMapConfig, scheduler: KMSchedulerInterface, pixelDensity: Float, is3D: Boolean): KMMapInterface { + val result = MapInterface.createWithOpenGl(mapConfig.asPlatform(), scheduler.asPlatform(), pixelDensity, is3D) + return (result as io.openmobilemaps.mapscore.shared.map.MapInterface).asKmp() + } + } +} + +internal fun KMMapInterface.asPlatform(): MapInterface = nativeHandle as MapInterface +public fun MapInterface.asKmp(): KMMapInterface = KMMapInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapReadyCallbackInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapReadyCallbackInterface.kt new file mode 100644 index 000000000..1993c13c5 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapReadyCallbackInterface.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.MapReadyCallbackInterface + +actual interface KMMapReadyCallbackInterface +{ + + actual fun stateDidUpdate(state: KMLayerReadyState) +} + +private class KMMapReadyCallbackInterfacePlatformWrapper(internal val nativeHandle: MapReadyCallbackInterface) : KMMapReadyCallbackInterface +{ + + override fun stateDidUpdate(state: KMLayerReadyState) { + nativeHandle.stateDidUpdate(state.asPlatform()) + } +} + +private class KMMapReadyCallbackInterfacePlatformProxy(private val delegate: KMMapReadyCallbackInterface) : MapReadyCallbackInterface() +{ + + override fun stateDidUpdate(state: io.openmobilemaps.mapscore.shared.map.LayerReadyState) { + delegate.stateDidUpdate((state as io.openmobilemaps.mapscore.shared.map.LayerReadyState).asKmp()) + } +} + +internal fun KMMapReadyCallbackInterface.asPlatform(): MapReadyCallbackInterface = when (this) { + is KMMapReadyCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMMapReadyCallbackInterfacePlatformProxy(this) +} +public fun MapReadyCallbackInterface.asKmp(): KMMapReadyCallbackInterface = KMMapReadyCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapsCoreSharedModule.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapsCoreSharedModule.kt new file mode 100644 index 000000000..aeacef210 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapsCoreSharedModule.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from maps_core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.MapsCoreSharedModule + +actual class KMMapsCoreSharedModule actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapsCoreSharedModule + + actual companion object + { + + actual fun version(): String { + val result = MapsCoreSharedModule.version() + return result + } + } +} + +internal fun KMMapsCoreSharedModule.asPlatform(): MapsCoreSharedModule = nativeHandle as MapsCoreSharedModule +public fun MapsCoreSharedModule.asKmp(): KMMapsCoreSharedModule = KMMapsCoreSharedModule(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMaskingObjectInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMaskingObjectInterface.kt new file mode 100644 index 000000000..f08f945af --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMaskingObjectInterface.kt @@ -0,0 +1,46 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.MaskingObjectInterface + +actual interface KMMaskingObjectInterface +{ + + actual fun asGraphicsObject(): KMGraphicsObjectInterface + + actual fun renderAsMask(context: KMRenderingContextInterface, renderPass: KMRenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) +} + +private class KMMaskingObjectInterfacePlatformWrapper(internal val nativeHandle: MaskingObjectInterface) : KMMaskingObjectInterface +{ + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface).asKmp() + } + + override fun renderAsMask(context: KMRenderingContextInterface, renderPass: KMRenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) { + nativeHandle.renderAsMask(context.asPlatform(), renderPass.asPlatform(), vpMatrix, mMatrix, origin.asPlatform(), screenPixelAsRealMeterFactor, isScreenSpaceCoords) + } +} + +private class KMMaskingObjectInterfacePlatformProxy(private val delegate: KMMaskingObjectInterface) : MaskingObjectInterface() +{ + + override fun asGraphicsObject(): io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } + + override fun renderAsMask(context: io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface, renderPass: io.openmobilemaps.mapscore.shared.graphics.RenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) { + delegate.renderAsMask((context as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp(), (renderPass as io.openmobilemaps.mapscore.shared.graphics.RenderPassConfig).asKmp(), vpMatrix, mMatrix, (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp(), screenPixelAsRealMeterFactor, isScreenSpaceCoords) + } +} + +internal fun KMMaskingObjectInterface.asPlatform(): MaskingObjectInterface = when (this) { + is KMMaskingObjectInterfacePlatformWrapper -> this.nativeHandle + else -> KMMaskingObjectInterfacePlatformProxy(this) +} +public fun MaskingObjectInterface.asKmp(): KMMaskingObjectInterface = KMMaskingObjectInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlPerformanceLoggerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlPerformanceLoggerInterface.kt new file mode 100644 index 000000000..003e37baf --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlPerformanceLoggerInterface.kt @@ -0,0 +1,35 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.OpenGlPerformanceLoggerInterface + +actual class KMOpenGlPerformanceLoggerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as OpenGlPerformanceLoggerInterface + + actual fun asPerformanceLoggerInterface(): KMPerformanceLoggerInterface { + val result = native.asPerformanceLoggerInterface() + return (result as io.openmobilemaps.mapscore.shared.map.PerformanceLoggerInterface).asKmp() + } + + actual companion object + { + + actual fun create(): KMOpenGlPerformanceLoggerInterface { + val result = OpenGlPerformanceLoggerInterface.create() + return (result as io.openmobilemaps.mapscore.shared.map.OpenGlPerformanceLoggerInterface).asKmp() + } + + actual fun createSpecifically(numBuckets: Int, bucketSizeMs: Long): KMOpenGlPerformanceLoggerInterface { + val result = OpenGlPerformanceLoggerInterface.createSpecifically(numBuckets, bucketSizeMs) + return (result as io.openmobilemaps.mapscore.shared.map.OpenGlPerformanceLoggerInterface).asKmp() + } + } +} + +internal fun KMOpenGlPerformanceLoggerInterface.asPlatform(): OpenGlPerformanceLoggerInterface = nativeHandle as OpenGlPerformanceLoggerInterface +public fun OpenGlPerformanceLoggerInterface.asKmp(): KMOpenGlPerformanceLoggerInterface = KMOpenGlPerformanceLoggerInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderTargetInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderTargetInterface.kt new file mode 100644 index 000000000..cc920a3e9 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderTargetInterface.kt @@ -0,0 +1,88 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.OpenGlRenderTargetInterface + +actual interface KMOpenGlRenderTargetInterface +{ + + actual fun asRenderTargetInterface(): KMRenderTargetInterface + + actual fun setup(size: KMVec2I) + + actual fun clear() + + actual fun bindFramebuffer(renderingContext: KMRenderingContextInterface) + + actual fun unbindFramebuffer() + + actual fun getTextureId(): Int +} + +private class KMOpenGlRenderTargetInterfacePlatformWrapper(internal val nativeHandle: OpenGlRenderTargetInterface) : KMOpenGlRenderTargetInterface +{ + + override fun asRenderTargetInterface(): KMRenderTargetInterface { + val result = nativeHandle.asRenderTargetInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.RenderTargetInterface).asKmp() + } + + override fun setup(size: KMVec2I) { + nativeHandle.setup(size.asPlatform()) + } + + override fun clear() { + nativeHandle.clear() + } + + override fun bindFramebuffer(renderingContext: KMRenderingContextInterface) { + nativeHandle.bindFramebuffer(renderingContext.asPlatform()) + } + + override fun unbindFramebuffer() { + nativeHandle.unbindFramebuffer() + } + + override fun getTextureId(): Int { + val result = nativeHandle.getTextureId() + return result + } +} + +private class KMOpenGlRenderTargetInterfacePlatformProxy(private val delegate: KMOpenGlRenderTargetInterface) : OpenGlRenderTargetInterface() +{ + + override fun asRenderTargetInterface(): io.openmobilemaps.mapscore.shared.graphics.RenderTargetInterface { + val result = delegate.asRenderTargetInterface() + return result.asPlatform() + } + + override fun setup(size: io.openmobilemaps.mapscore.shared.graphics.common.Vec2I) { + delegate.setup((size as io.openmobilemaps.mapscore.shared.graphics.common.Vec2I).asKmp()) + } + + override fun clear() { + delegate.clear() + } + + override fun bindFramebuffer(renderingContext: io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface) { + delegate.bindFramebuffer((renderingContext as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp()) + } + + override fun unbindFramebuffer() { + delegate.unbindFramebuffer() + } + + override fun getTextureId(): Int { + val result = delegate.getTextureId() + return result + } +} + +internal fun KMOpenGlRenderTargetInterface.asPlatform(): OpenGlRenderTargetInterface = when (this) { + is KMOpenGlRenderTargetInterfacePlatformWrapper -> this.nativeHandle + else -> KMOpenGlRenderTargetInterfacePlatformProxy(this) +} +public fun OpenGlRenderTargetInterface.asKmp(): KMOpenGlRenderTargetInterface = KMOpenGlRenderTargetInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderingContextInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderingContextInterface.kt new file mode 100644 index 000000000..cd58fb7d6 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderingContextInterface.kt @@ -0,0 +1,124 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.OpenGlRenderingContextInterface + +actual interface KMOpenGlRenderingContextInterface +{ + + actual fun resume() + + actual fun pause() + + actual fun getCreateRenderTarget(name: String, textureFilter: KMTextureFilterType, clearColor: KMColor, usesDepthStencil: Boolean): KMOpenGlRenderTargetInterface + + actual fun deleteRenderTarget(name: String) + + actual fun getRenderTargets(): ArrayList + + actual fun getProgram(name: String): Int + + actual fun storeProgram(name: String, program: Int) + + actual fun getAspectRatio(): Float + + actual fun getDeltaTimeMs(): Long +} + +private class KMOpenGlRenderingContextInterfacePlatformWrapper(internal val nativeHandle: OpenGlRenderingContextInterface) : KMOpenGlRenderingContextInterface +{ + + override fun resume() { + nativeHandle.resume() + } + + override fun pause() { + nativeHandle.pause() + } + + override fun getCreateRenderTarget(name: String, textureFilter: KMTextureFilterType, clearColor: KMColor, usesDepthStencil: Boolean): KMOpenGlRenderTargetInterface { + val result = nativeHandle.getCreateRenderTarget(name, textureFilter.asPlatform(), clearColor.asPlatform(), usesDepthStencil) + return (result as io.openmobilemaps.mapscore.shared.graphics.OpenGlRenderTargetInterface).asKmp() + } + + override fun deleteRenderTarget(name: String) { + nativeHandle.deleteRenderTarget(name) + } + + override fun getRenderTargets(): ArrayList { + val result = nativeHandle.getRenderTargets() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.graphics.OpenGlRenderTargetInterface).asKmp() }) + } + + override fun getProgram(name: String): Int { + val result = nativeHandle.getProgram(name) + return result + } + + override fun storeProgram(name: String, program: Int) { + nativeHandle.storeProgram(name, program) + } + + override fun getAspectRatio(): Float { + val result = nativeHandle.getAspectRatio() + return result + } + + override fun getDeltaTimeMs(): Long { + val result = nativeHandle.getDeltaTimeMs() + return result + } +} + +private class KMOpenGlRenderingContextInterfacePlatformProxy(private val delegate: KMOpenGlRenderingContextInterface) : OpenGlRenderingContextInterface() +{ + + override fun resume() { + delegate.resume() + } + + override fun pause() { + delegate.pause() + } + + override fun getCreateRenderTarget(name: String, textureFilter: io.openmobilemaps.mapscore.shared.graphics.objects.TextureFilterType, clearColor: io.openmobilemaps.mapscore.shared.graphics.common.Color, usesDepthStencil: Boolean): io.openmobilemaps.mapscore.shared.graphics.OpenGlRenderTargetInterface { + val result = delegate.getCreateRenderTarget(name, (textureFilter as io.openmobilemaps.mapscore.shared.graphics.objects.TextureFilterType).asKmp(), (clearColor as io.openmobilemaps.mapscore.shared.graphics.common.Color).asKmp(), usesDepthStencil) + return result.asPlatform() + } + + override fun deleteRenderTarget(name: String) { + delegate.deleteRenderTarget(name) + } + + override fun getRenderTargets(): ArrayList { + val result = delegate.getRenderTargets() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun getProgram(name: String): Int { + val result = delegate.getProgram(name) + return result + } + + override fun storeProgram(name: String, program: Int) { + delegate.storeProgram(name, program) + } + + override fun getAspectRatio(): Float { + val result = delegate.getAspectRatio() + return result + } + + override fun getDeltaTimeMs(): Long { + val result = delegate.getDeltaTimeMs() + return result + } +} + +internal fun KMOpenGlRenderingContextInterface.asPlatform(): OpenGlRenderingContextInterface = when (this) { + is KMOpenGlRenderingContextInterfacePlatformWrapper -> this.nativeHandle + else -> KMOpenGlRenderingContextInterfacePlatformProxy(this) +} +public fun OpenGlRenderingContextInterface.asKmp(): KMOpenGlRenderingContextInterface = KMOpenGlRenderingContextInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPerformanceLoggerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPerformanceLoggerInterface.kt new file mode 100644 index 000000000..6022a98cd --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPerformanceLoggerInterface.kt @@ -0,0 +1,100 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.PerformanceLoggerInterface + +actual interface KMPerformanceLoggerInterface +{ + + actual fun getLoggerName(): String + + actual fun startLog(id: String) + + actual fun endLog(id: String) + + actual fun getStatistics(id: String): KMLoggerData? + + actual fun getAllStatistics(): ArrayList + + actual fun resetData() + + actual fun setLoggingEnabled(enabled: Boolean) +} + +private class KMPerformanceLoggerInterfacePlatformWrapper(internal val nativeHandle: PerformanceLoggerInterface) : KMPerformanceLoggerInterface +{ + + override fun getLoggerName(): String { + val result = nativeHandle.getLoggerName() + return result + } + + override fun startLog(id: String) { + nativeHandle.startLog(id) + } + + override fun endLog(id: String) { + nativeHandle.endLog(id) + } + + override fun getStatistics(id: String): KMLoggerData? { + val result = nativeHandle.getStatistics(id) + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.LoggerData).asKmp() } + } + + override fun getAllStatistics(): ArrayList { + val result = nativeHandle.getAllStatistics() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.LoggerData).asKmp() }) + } + + override fun resetData() { + nativeHandle.resetData() + } + + override fun setLoggingEnabled(enabled: Boolean) { + nativeHandle.setLoggingEnabled(enabled) + } +} + +private class KMPerformanceLoggerInterfacePlatformProxy(private val delegate: KMPerformanceLoggerInterface) : PerformanceLoggerInterface() +{ + + override fun getLoggerName(): String { + val result = delegate.getLoggerName() + return result + } + + override fun startLog(id: String) { + delegate.startLog(id) + } + + override fun endLog(id: String) { + delegate.endLog(id) + } + + override fun getStatistics(id: String): io.openmobilemaps.mapscore.shared.map.LoggerData? { + val result = delegate.getStatistics(id) + return result?.let { it.asPlatform() } + } + + override fun getAllStatistics(): ArrayList { + val result = delegate.getAllStatistics() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun resetData() { + delegate.resetData() + } + + override fun setLoggingEnabled(enabled: Boolean) { + delegate.setLoggingEnabled(enabled) + } +} + +internal fun KMPerformanceLoggerInterface.asPlatform(): PerformanceLoggerInterface = when (this) { + is KMPerformanceLoggerInterfacePlatformWrapper -> this.nativeHandle + else -> KMPerformanceLoggerInterfacePlatformProxy(this) +} +public fun PerformanceLoggerInterface.asKmp(): KMPerformanceLoggerInterface = KMPerformanceLoggerInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygon2dInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygon2dInterface.kt new file mode 100644 index 000000000..5377e38f7 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygon2dInterface.kt @@ -0,0 +1,68 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.Polygon2dInterface + +actual interface KMPolygon2dInterface +{ + + actual fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D, is3d: Boolean) + + actual fun setSubdivisionFactor(factor: Int) + + actual fun asGraphicsObject(): KMGraphicsObjectInterface + + actual fun asMaskingObject(): KMMaskingObjectInterface +} + +private class KMPolygon2dInterfacePlatformWrapper(internal val nativeHandle: Polygon2dInterface) : KMPolygon2dInterface +{ + + override fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D, is3d: Boolean) { + nativeHandle.setVertices(vertices.asPlatform(), indices.asPlatform(), origin.asPlatform(), is3d) + } + + override fun setSubdivisionFactor(factor: Int) { + nativeHandle.setSubdivisionFactor(factor) + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface).asKmp() + } + + override fun asMaskingObject(): KMMaskingObjectInterface { + val result = nativeHandle.asMaskingObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.MaskingObjectInterface).asKmp() + } +} + +private class KMPolygon2dInterfacePlatformProxy(private val delegate: KMPolygon2dInterface) : Polygon2dInterface() +{ + + override fun setVertices(vertices: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes, indices: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D, is3d: Boolean) { + delegate.setVertices((vertices as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp(), (indices as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp(), (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp(), is3d) + } + + override fun setSubdivisionFactor(factor: Int) { + delegate.setSubdivisionFactor(factor) + } + + override fun asGraphicsObject(): io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } + + override fun asMaskingObject(): io.openmobilemaps.mapscore.shared.graphics.objects.MaskingObjectInterface { + val result = delegate.asMaskingObject() + return result.asPlatform() + } +} + +internal fun KMPolygon2dInterface.asPlatform(): Polygon2dInterface = when (this) { + is KMPolygon2dInterfacePlatformWrapper -> this.nativeHandle + else -> KMPolygon2dInterfacePlatformProxy(this) +} +public fun Polygon2dInterface.asKmp(): KMPolygon2dInterface = KMPolygon2dInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonCoord.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonCoord.kt new file mode 100644 index 000000000..500417ebd --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonCoord.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMPolygonCoord = io.openmobilemaps.mapscore.shared.map.coordinates.PolygonCoord + +internal fun KMPolygonCoord.asPlatform(): io.openmobilemaps.mapscore.shared.map.coordinates.PolygonCoord = this +public fun io.openmobilemaps.mapscore.shared.map.coordinates.PolygonCoord.asKmp(): KMPolygonCoord = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroup2dInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroup2dInterface.kt new file mode 100644 index 000000000..f4dfb8fa5 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroup2dInterface.kt @@ -0,0 +1,46 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.PolygonGroup2dInterface + +actual interface KMPolygonGroup2dInterface +{ + + actual fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) + + actual fun asGraphicsObject(): KMGraphicsObjectInterface +} + +private class KMPolygonGroup2dInterfacePlatformWrapper(internal val nativeHandle: PolygonGroup2dInterface) : KMPolygonGroup2dInterface +{ + + override fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) { + nativeHandle.setVertices(vertices.asPlatform(), indices.asPlatform(), origin.asPlatform()) + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface).asKmp() + } +} + +private class KMPolygonGroup2dInterfacePlatformProxy(private val delegate: KMPolygonGroup2dInterface) : PolygonGroup2dInterface() +{ + + override fun setVertices(vertices: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes, indices: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D) { + delegate.setVertices((vertices as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp(), (indices as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp(), (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp()) + } + + override fun asGraphicsObject(): io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } +} + +internal fun KMPolygonGroup2dInterface.asPlatform(): PolygonGroup2dInterface = when (this) { + is KMPolygonGroup2dInterfacePlatformWrapper -> this.nativeHandle + else -> KMPolygonGroup2dInterfacePlatformProxy(this) +} +public fun PolygonGroup2dInterface.asKmp(): KMPolygonGroup2dInterface = KMPolygonGroup2dInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroupShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroupShaderInterface.kt new file mode 100644 index 000000000..731cafd45 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroupShaderInterface.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.PolygonGroupShaderInterface + +actual class KMPolygonGroupShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as PolygonGroupShaderInterface + + actual fun setStyles(styles: KMSharedBytes) { + native.setStyles(styles.asPlatform()) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } +} + +internal fun KMPolygonGroupShaderInterface.asPlatform(): PolygonGroupShaderInterface = nativeHandle as PolygonGroupShaderInterface +public fun PolygonGroupShaderInterface.asKmp(): KMPolygonGroupShaderInterface = KMPolygonGroupShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonInfo.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonInfo.kt new file mode 100644 index 000000000..1242737f2 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonInfo.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMPolygonInfo = io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonInfo + +internal fun KMPolygonInfo.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonInfo = this +public fun io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonInfo.asKmp(): KMPolygonInfo = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerCallbackInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerCallbackInterface.kt new file mode 100644 index 000000000..b9d890b90 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerCallbackInterface.kt @@ -0,0 +1,48 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonLayerCallbackInterface + +actual interface KMPolygonLayerCallbackInterface +{ + + actual fun onClickConfirmed(polygon: KMPolygonInfo): Boolean + + actual fun onClickUnconfirmed(polygon: KMPolygonInfo): Boolean +} + +private class KMPolygonLayerCallbackInterfacePlatformWrapper(internal val nativeHandle: PolygonLayerCallbackInterface) : KMPolygonLayerCallbackInterface +{ + + override fun onClickConfirmed(polygon: KMPolygonInfo): Boolean { + val result = nativeHandle.onClickConfirmed(polygon.asPlatform()) + return result + } + + override fun onClickUnconfirmed(polygon: KMPolygonInfo): Boolean { + val result = nativeHandle.onClickUnconfirmed(polygon.asPlatform()) + return result + } +} + +private class KMPolygonLayerCallbackInterfacePlatformProxy(private val delegate: KMPolygonLayerCallbackInterface) : PolygonLayerCallbackInterface() +{ + + override fun onClickConfirmed(polygon: io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonInfo): Boolean { + val result = delegate.onClickConfirmed((polygon as io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonInfo).asKmp()) + return result + } + + override fun onClickUnconfirmed(polygon: io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonInfo): Boolean { + val result = delegate.onClickUnconfirmed((polygon as io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonInfo).asKmp()) + return result + } +} + +internal fun KMPolygonLayerCallbackInterface.asPlatform(): PolygonLayerCallbackInterface = when (this) { + is KMPolygonLayerCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMPolygonLayerCallbackInterfacePlatformProxy(this) +} +public fun PolygonLayerCallbackInterface.asKmp(): KMPolygonLayerCallbackInterface = KMPolygonLayerCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerInterface.kt new file mode 100644 index 000000000..ebb8ef599 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerInterface.kt @@ -0,0 +1,71 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonLayerInterface + +actual class KMPolygonLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as PolygonLayerInterface + + actual fun setPolygons(polygons: ArrayList, origin: KMVec3D) { + native.setPolygons(ArrayList(polygons.map { it.asPlatform() }), origin.asPlatform()) + } + + actual fun getPolygons(): ArrayList { + val result = native.getPolygons() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonInfo).asKmp() }) + } + + actual fun remove(polygon: KMPolygonInfo) { + native.remove(polygon.asPlatform()) + } + + actual fun add(polygon: KMPolygonInfo) { + native.add(polygon.asPlatform()) + } + + actual fun addAll(polygons: ArrayList) { + native.addAll(ArrayList(polygons.map { it.asPlatform() })) + } + + actual fun clear() { + native.clear() + } + + actual fun setCallbackHandler(handler: KMPolygonLayerCallbackInterface) { + native.setCallbackHandler(handler.asPlatform()) + } + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as io.openmobilemaps.mapscore.shared.map.LayerInterface).asKmp() + } + + actual fun resetSelection() { + native.resetSelection() + } + + actual fun setLayerClickable(isLayerClickable: Boolean) { + native.setLayerClickable(isLayerClickable) + } + + actual fun setRenderPassIndex(index: Int) { + native.setRenderPassIndex(index) + } + + actual companion object + { + + actual fun create(): KMPolygonLayerInterface { + val result = PolygonLayerInterface.create() + return (result as io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonLayerInterface).asKmp() + } + } +} + +internal fun KMPolygonLayerInterface.asPlatform(): PolygonLayerInterface = nativeHandle as PolygonLayerInterface +public fun PolygonLayerInterface.asKmp(): KMPolygonLayerInterface = KMPolygonLayerInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonMaskObjectInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonMaskObjectInterface.kt new file mode 100644 index 000000000..9eb7b0765 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonMaskObjectInterface.kt @@ -0,0 +1,38 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonMaskObjectInterface + +actual class KMPolygonMaskObjectInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as PolygonMaskObjectInterface + + actual fun setPolygons(polygons: ArrayList, origin: KMVec3D) { + native.setPolygons(ArrayList(polygons.map { it.asPlatform() }), origin.asPlatform()) + } + + actual fun setPolygon(polygon: KMPolygonCoord, origin: KMVec3D) { + native.setPolygon(polygon.asPlatform(), origin.asPlatform()) + } + + actual fun getPolygonObject(): KMPolygon2dInterface { + val result = native.getPolygonObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.Polygon2dInterface).asKmp() + } + + actual companion object + { + + actual fun create(graphicsObjectFactory: KMGraphicsObjectFactoryInterface, conversionHelper: KMCoordinateConversionHelperInterface, is3d: Boolean): KMPolygonMaskObjectInterface { + val result = PolygonMaskObjectInterface.create(graphicsObjectFactory.asPlatform(), conversionHelper.asPlatform(), is3d) + return (result as io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonMaskObjectInterface).asKmp() + } + } +} + +internal fun KMPolygonMaskObjectInterface.asPlatform(): PolygonMaskObjectInterface = nativeHandle as PolygonMaskObjectInterface +public fun PolygonMaskObjectInterface.asKmp(): KMPolygonMaskObjectInterface = KMPolygonMaskObjectInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroup2dInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroup2dInterface.kt new file mode 100644 index 000000000..e3138038d --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroup2dInterface.kt @@ -0,0 +1,106 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.PolygonPatternGroup2dInterface + +actual interface KMPolygonPatternGroup2dInterface +{ + + actual fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) + + actual fun setOpacities(values: KMSharedBytes) + + actual fun setTextureCoordinates(values: KMSharedBytes) + + actual fun setScalingFactor(factor: Float) + + actual fun setScalingFactors(factor: KMVec2F) + + actual fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + actual fun removeTexture() + + actual fun asGraphicsObject(): KMGraphicsObjectInterface +} + +private class KMPolygonPatternGroup2dInterfacePlatformWrapper(internal val nativeHandle: PolygonPatternGroup2dInterface) : KMPolygonPatternGroup2dInterface +{ + + override fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) { + nativeHandle.setVertices(vertices.asPlatform(), indices.asPlatform(), origin.asPlatform()) + } + + override fun setOpacities(values: KMSharedBytes) { + nativeHandle.setOpacities(values.asPlatform()) + } + + override fun setTextureCoordinates(values: KMSharedBytes) { + nativeHandle.setTextureCoordinates(values.asPlatform()) + } + + override fun setScalingFactor(factor: Float) { + nativeHandle.setScalingFactor(factor) + } + + override fun setScalingFactors(factor: KMVec2F) { + nativeHandle.setScalingFactors(factor.asPlatform()) + } + + override fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) { + nativeHandle.loadTexture(context.asPlatform(), textureHolder.asPlatform()) + } + + override fun removeTexture() { + nativeHandle.removeTexture() + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface).asKmp() + } +} + +private class KMPolygonPatternGroup2dInterfacePlatformProxy(private val delegate: KMPolygonPatternGroup2dInterface) : PolygonPatternGroup2dInterface() +{ + + override fun setVertices(vertices: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes, indices: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D) { + delegate.setVertices((vertices as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp(), (indices as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp(), (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp()) + } + + override fun setOpacities(values: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setOpacities((values as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setTextureCoordinates(values: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setTextureCoordinates((values as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setScalingFactor(factor: Float) { + delegate.setScalingFactor(factor) + } + + override fun setScalingFactors(factor: io.openmobilemaps.mapscore.shared.graphics.common.Vec2F) { + delegate.setScalingFactors((factor as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp()) + } + + override fun loadTexture(context: io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface, textureHolder: io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface) { + delegate.loadTexture((context as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp(), (textureHolder as io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface).asKmp()) + } + + override fun removeTexture() { + delegate.removeTexture() + } + + override fun asGraphicsObject(): io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } +} + +internal fun KMPolygonPatternGroup2dInterface.asPlatform(): PolygonPatternGroup2dInterface = when (this) { + is KMPolygonPatternGroup2dInterfacePlatformWrapper -> this.nativeHandle + else -> KMPolygonPatternGroup2dInterfacePlatformProxy(this) +} +public fun PolygonPatternGroup2dInterface.asKmp(): KMPolygonPatternGroup2dInterface = KMPolygonPatternGroup2dInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroupShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroupShaderInterface.kt new file mode 100644 index 000000000..64531f5ed --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroupShaderInterface.kt @@ -0,0 +1,21 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.PolygonPatternGroupShaderInterface + +actual class KMPolygonPatternGroupShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as PolygonPatternGroupShaderInterface + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } +} + +internal fun KMPolygonPatternGroupShaderInterface.asPlatform(): PolygonPatternGroupShaderInterface = nativeHandle as PolygonPatternGroupShaderInterface +public fun PolygonPatternGroupShaderInterface.asKmp(): KMPolygonPatternGroupShaderInterface = KMPolygonPatternGroupShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonStyle.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonStyle.kt new file mode 100644 index 000000000..5e1d0cd81 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonStyle.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMPolygonStyle = io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonStyle + +internal fun KMPolygonStyle.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonStyle = this +public fun io.openmobilemaps.mapscore.shared.map.layers.polygon.PolygonStyle.asKmp(): KMPolygonStyle = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dD.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dD.kt new file mode 100644 index 000000000..4df185ca8 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dD.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMQuad2dD = io.openmobilemaps.mapscore.shared.graphics.common.Quad2dD + +internal fun KMQuad2dD.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.Quad2dD = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.Quad2dD.asKmp(): KMQuad2dD = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInstancedInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInstancedInterface.kt new file mode 100644 index 000000000..12ba00f21 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInstancedInterface.kt @@ -0,0 +1,148 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.Quad2dInstancedInterface + +actual interface KMQuad2dInstancedInterface +{ + + actual fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) + + actual fun setInstanceCount(count: Int) + + actual fun setPositions(positions: KMSharedBytes) + + actual fun setScales(scales: KMSharedBytes) + + actual fun setRotations(rotations: KMSharedBytes) + + actual fun setAlphas(values: KMSharedBytes) + + actual fun setTextureCoordinates(textureCoordinates: KMSharedBytes) + + actual fun setPositionOffset(offsets: KMSharedBytes) + + actual fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + actual fun removeTexture() + + actual fun asGraphicsObject(): KMGraphicsObjectInterface + + actual fun asMaskingObject(): KMMaskingObjectInterface +} + +private class KMQuad2dInstancedInterfacePlatformWrapper(internal val nativeHandle: Quad2dInstancedInterface) : KMQuad2dInstancedInterface +{ + + override fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) { + nativeHandle.setFrame(frame.asPlatform(), origin.asPlatform(), is3d) + } + + override fun setInstanceCount(count: Int) { + nativeHandle.setInstanceCount(count) + } + + override fun setPositions(positions: KMSharedBytes) { + nativeHandle.setPositions(positions.asPlatform()) + } + + override fun setScales(scales: KMSharedBytes) { + nativeHandle.setScales(scales.asPlatform()) + } + + override fun setRotations(rotations: KMSharedBytes) { + nativeHandle.setRotations(rotations.asPlatform()) + } + + override fun setAlphas(values: KMSharedBytes) { + nativeHandle.setAlphas(values.asPlatform()) + } + + override fun setTextureCoordinates(textureCoordinates: KMSharedBytes) { + nativeHandle.setTextureCoordinates(textureCoordinates.asPlatform()) + } + + override fun setPositionOffset(offsets: KMSharedBytes) { + nativeHandle.setPositionOffset(offsets.asPlatform()) + } + + override fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) { + nativeHandle.loadTexture(context.asPlatform(), textureHolder.asPlatform()) + } + + override fun removeTexture() { + nativeHandle.removeTexture() + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface).asKmp() + } + + override fun asMaskingObject(): KMMaskingObjectInterface { + val result = nativeHandle.asMaskingObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.MaskingObjectInterface).asKmp() + } +} + +private class KMQuad2dInstancedInterfacePlatformProxy(private val delegate: KMQuad2dInstancedInterface) : Quad2dInstancedInterface() +{ + + override fun setFrame(frame: io.openmobilemaps.mapscore.shared.graphics.common.Quad2dD, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D, is3d: Boolean) { + delegate.setFrame((frame as io.openmobilemaps.mapscore.shared.graphics.common.Quad2dD).asKmp(), (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp(), is3d) + } + + override fun setInstanceCount(count: Int) { + delegate.setInstanceCount(count) + } + + override fun setPositions(positions: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setPositions((positions as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setScales(scales: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setScales((scales as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setRotations(rotations: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setRotations((rotations as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setAlphas(values: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setAlphas((values as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setTextureCoordinates(textureCoordinates: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setTextureCoordinates((textureCoordinates as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setPositionOffset(offsets: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setPositionOffset((offsets as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun loadTexture(context: io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface, textureHolder: io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface) { + delegate.loadTexture((context as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp(), (textureHolder as io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface).asKmp()) + } + + override fun removeTexture() { + delegate.removeTexture() + } + + override fun asGraphicsObject(): io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } + + override fun asMaskingObject(): io.openmobilemaps.mapscore.shared.graphics.objects.MaskingObjectInterface { + val result = delegate.asMaskingObject() + return result.asPlatform() + } +} + +internal fun KMQuad2dInstancedInterface.asPlatform(): Quad2dInstancedInterface = when (this) { + is KMQuad2dInstancedInterfacePlatformWrapper -> this.nativeHandle + else -> KMQuad2dInstancedInterfacePlatformProxy(this) +} +public fun Quad2dInstancedInterface.asKmp(): KMQuad2dInstancedInterface = KMQuad2dInstancedInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInterface.kt new file mode 100644 index 000000000..e020a5957 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInterface.kt @@ -0,0 +1,98 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.Quad2dInterface + +actual interface KMQuad2dInterface +{ + + actual fun setFrame(frame: KMQuad3dD, textureCoordinates: KMRectD, origin: KMVec3D, is3d: Boolean) + + actual fun setSubdivisionFactor(factor: Int) + + actual fun setMinMagFilter(filterType: KMTextureFilterType) + + actual fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + actual fun removeTexture() + + actual fun asGraphicsObject(): KMGraphicsObjectInterface + + actual fun asMaskingObject(): KMMaskingObjectInterface +} + +private class KMQuad2dInterfacePlatformWrapper(internal val nativeHandle: Quad2dInterface) : KMQuad2dInterface +{ + + override fun setFrame(frame: KMQuad3dD, textureCoordinates: KMRectD, origin: KMVec3D, is3d: Boolean) { + nativeHandle.setFrame(frame.asPlatform(), textureCoordinates.asPlatform(), origin.asPlatform(), is3d) + } + + override fun setSubdivisionFactor(factor: Int) { + nativeHandle.setSubdivisionFactor(factor) + } + + override fun setMinMagFilter(filterType: KMTextureFilterType) { + nativeHandle.setMinMagFilter(filterType.asPlatform()) + } + + override fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) { + nativeHandle.loadTexture(context.asPlatform(), textureHolder.asPlatform()) + } + + override fun removeTexture() { + nativeHandle.removeTexture() + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface).asKmp() + } + + override fun asMaskingObject(): KMMaskingObjectInterface { + val result = nativeHandle.asMaskingObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.MaskingObjectInterface).asKmp() + } +} + +private class KMQuad2dInterfacePlatformProxy(private val delegate: KMQuad2dInterface) : Quad2dInterface() +{ + + override fun setFrame(frame: io.openmobilemaps.mapscore.shared.graphics.common.Quad3dD, textureCoordinates: io.openmobilemaps.mapscore.shared.graphics.common.RectD, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D, is3d: Boolean) { + delegate.setFrame((frame as io.openmobilemaps.mapscore.shared.graphics.common.Quad3dD).asKmp(), (textureCoordinates as io.openmobilemaps.mapscore.shared.graphics.common.RectD).asKmp(), (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp(), is3d) + } + + override fun setSubdivisionFactor(factor: Int) { + delegate.setSubdivisionFactor(factor) + } + + override fun setMinMagFilter(filterType: io.openmobilemaps.mapscore.shared.graphics.objects.TextureFilterType) { + delegate.setMinMagFilter((filterType as io.openmobilemaps.mapscore.shared.graphics.objects.TextureFilterType).asKmp()) + } + + override fun loadTexture(context: io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface, textureHolder: io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface) { + delegate.loadTexture((context as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp(), (textureHolder as io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface).asKmp()) + } + + override fun removeTexture() { + delegate.removeTexture() + } + + override fun asGraphicsObject(): io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } + + override fun asMaskingObject(): io.openmobilemaps.mapscore.shared.graphics.objects.MaskingObjectInterface { + val result = delegate.asMaskingObject() + return result.asPlatform() + } +} + +internal fun KMQuad2dInterface.asPlatform(): Quad2dInterface = when (this) { + is KMQuad2dInterfacePlatformWrapper -> this.nativeHandle + else -> KMQuad2dInterfacePlatformProxy(this) +} +public fun Quad2dInterface.asKmp(): KMQuad2dInterface = KMQuad2dInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dStretchedInstancedInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dStretchedInstancedInterface.kt new file mode 100644 index 000000000..0322535c8 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dStretchedInstancedInterface.kt @@ -0,0 +1,148 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.Quad2dStretchedInstancedInterface + +actual interface KMQuad2dStretchedInstancedInterface +{ + + actual fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) + + actual fun setInstanceCount(count: Int) + + actual fun setPositions(positions: KMSharedBytes) + + actual fun setScales(scales: KMSharedBytes) + + actual fun setRotations(rotations: KMSharedBytes) + + actual fun setAlphas(values: KMSharedBytes) + + actual fun setStretchInfos(values: KMSharedBytes) + + actual fun setTextureCoordinates(textureCoordinates: KMSharedBytes) + + actual fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + actual fun removeTexture() + + actual fun asGraphicsObject(): KMGraphicsObjectInterface + + actual fun asMaskingObject(): KMMaskingObjectInterface +} + +private class KMQuad2dStretchedInstancedInterfacePlatformWrapper(internal val nativeHandle: Quad2dStretchedInstancedInterface) : KMQuad2dStretchedInstancedInterface +{ + + override fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) { + nativeHandle.setFrame(frame.asPlatform(), origin.asPlatform(), is3d) + } + + override fun setInstanceCount(count: Int) { + nativeHandle.setInstanceCount(count) + } + + override fun setPositions(positions: KMSharedBytes) { + nativeHandle.setPositions(positions.asPlatform()) + } + + override fun setScales(scales: KMSharedBytes) { + nativeHandle.setScales(scales.asPlatform()) + } + + override fun setRotations(rotations: KMSharedBytes) { + nativeHandle.setRotations(rotations.asPlatform()) + } + + override fun setAlphas(values: KMSharedBytes) { + nativeHandle.setAlphas(values.asPlatform()) + } + + override fun setStretchInfos(values: KMSharedBytes) { + nativeHandle.setStretchInfos(values.asPlatform()) + } + + override fun setTextureCoordinates(textureCoordinates: KMSharedBytes) { + nativeHandle.setTextureCoordinates(textureCoordinates.asPlatform()) + } + + override fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) { + nativeHandle.loadTexture(context.asPlatform(), textureHolder.asPlatform()) + } + + override fun removeTexture() { + nativeHandle.removeTexture() + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface).asKmp() + } + + override fun asMaskingObject(): KMMaskingObjectInterface { + val result = nativeHandle.asMaskingObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.MaskingObjectInterface).asKmp() + } +} + +private class KMQuad2dStretchedInstancedInterfacePlatformProxy(private val delegate: KMQuad2dStretchedInstancedInterface) : Quad2dStretchedInstancedInterface() +{ + + override fun setFrame(frame: io.openmobilemaps.mapscore.shared.graphics.common.Quad2dD, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D, is3d: Boolean) { + delegate.setFrame((frame as io.openmobilemaps.mapscore.shared.graphics.common.Quad2dD).asKmp(), (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp(), is3d) + } + + override fun setInstanceCount(count: Int) { + delegate.setInstanceCount(count) + } + + override fun setPositions(positions: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setPositions((positions as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setScales(scales: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setScales((scales as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setRotations(rotations: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setRotations((rotations as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setAlphas(values: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setAlphas((values as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setStretchInfos(values: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setStretchInfos((values as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setTextureCoordinates(textureCoordinates: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setTextureCoordinates((textureCoordinates as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun loadTexture(context: io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface, textureHolder: io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface) { + delegate.loadTexture((context as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp(), (textureHolder as io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface).asKmp()) + } + + override fun removeTexture() { + delegate.removeTexture() + } + + override fun asGraphicsObject(): io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } + + override fun asMaskingObject(): io.openmobilemaps.mapscore.shared.graphics.objects.MaskingObjectInterface { + val result = delegate.asMaskingObject() + return result.asPlatform() + } +} + +internal fun KMQuad2dStretchedInstancedInterface.asPlatform(): Quad2dStretchedInstancedInterface = when (this) { + is KMQuad2dStretchedInstancedInterfacePlatformWrapper -> this.nativeHandle + else -> KMQuad2dStretchedInstancedInterfacePlatformProxy(this) +} +public fun Quad2dStretchedInstancedInterface.asKmp(): KMQuad2dStretchedInstancedInterface = KMQuad2dStretchedInstancedInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad3dD.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad3dD.kt new file mode 100644 index 000000000..cfbbdce43 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad3dD.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMQuad3dD = io.openmobilemaps.mapscore.shared.graphics.common.Quad3dD + +internal fun KMQuad3dD.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.Quad3dD = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.Quad3dD.asKmp(): KMQuad3dD = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuadCoord.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuadCoord.kt new file mode 100644 index 000000000..a31349540 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuadCoord.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMQuadCoord = io.openmobilemaps.mapscore.shared.map.coordinates.QuadCoord + +internal fun KMQuadCoord.asPlatform(): io.openmobilemaps.mapscore.shared.map.coordinates.QuadCoord = this +public fun io.openmobilemaps.mapscore.shared.map.coordinates.QuadCoord.asKmp(): KMQuadCoord = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderInterface.kt new file mode 100644 index 000000000..357db6ae8 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderInterface.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.RasterShaderInterface + +actual class KMRasterShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as RasterShaderInterface + + actual fun setStyle(style: KMRasterShaderStyle) { + native.setStyle(style.asPlatform()) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } +} + +internal fun KMRasterShaderInterface.asPlatform(): RasterShaderInterface = nativeHandle as RasterShaderInterface +public fun RasterShaderInterface.asKmp(): KMRasterShaderInterface = KMRasterShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderStyle.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderStyle.kt new file mode 100644 index 000000000..1865609a3 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderStyle.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMRasterShaderStyle = io.openmobilemaps.mapscore.shared.graphics.shader.RasterShaderStyle + +internal fun KMRasterShaderStyle.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.shader.RasterShaderStyle = this +public fun io.openmobilemaps.mapscore.shared.graphics.shader.RasterShaderStyle.asKmp(): KMRasterShaderStyle = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectCoord.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectCoord.kt new file mode 100644 index 000000000..82900df7e --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectCoord.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMRectCoord = io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord + +internal fun KMRectCoord.asPlatform(): io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord = this +public fun io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord.asKmp(): KMRectCoord = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectD.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectD.kt new file mode 100644 index 000000000..352b63906 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectD.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMRectD = io.openmobilemaps.mapscore.shared.graphics.common.RectD + +internal fun KMRectD.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.RectD = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.RectD.asKmp(): KMRectD = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectF.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectF.kt new file mode 100644 index 000000000..46bf323d8 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectF.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMRectF = io.openmobilemaps.mapscore.shared.graphics.common.RectF + +internal fun KMRectF.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.RectF = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.RectF.asKmp(): KMRectF = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectI.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectI.kt new file mode 100644 index 000000000..d99e33c55 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectI.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMRectI = io.openmobilemaps.mapscore.shared.graphics.common.RectI + +internal fun KMRectI.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.RectI = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.RectI.asKmp(): KMRectI = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePacker.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePacker.kt new file mode 100644 index 000000000..65e943234 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePacker.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from packer.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.RectanglePacker + +actual class KMRectanglePacker actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as RectanglePacker + + actual companion object + { + + actual fun pack(rectangles: HashMap, maxPageSize: KMVec2I, spacing: Int): ArrayList { + val result = RectanglePacker.pack(HashMap(rectangles.map { it.key to it.value.asPlatform() }.toMap()), maxPageSize.asPlatform(), spacing) + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.graphics.RectanglePackerPage).asKmp() }) + } + } +} + +internal fun KMRectanglePacker.asPlatform(): RectanglePacker = nativeHandle as RectanglePacker +public fun RectanglePacker.asKmp(): KMRectanglePacker = KMRectanglePacker(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePackerPage.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePackerPage.kt new file mode 100644 index 000000000..209040057 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePackerPage.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from packer.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMRectanglePackerPage = io.openmobilemaps.mapscore.shared.graphics.RectanglePackerPage + +internal fun KMRectanglePackerPage.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.RectanglePackerPage = this +public fun io.openmobilemaps.mapscore.shared.graphics.RectanglePackerPage.asKmp(): KMRectanglePackerPage = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderConfigInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderConfigInterface.kt new file mode 100644 index 000000000..8c7dfc1c0 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderConfigInterface.kt @@ -0,0 +1,26 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from layer_object.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.objects.RenderConfigInterface + +actual class KMRenderConfigInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as RenderConfigInterface + + actual fun getGraphicsObject(): KMGraphicsObjectInterface { + val result = native.getGraphicsObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface).asKmp() + } + + actual fun getRenderIndex(): Int { + val result = native.getRenderIndex() + return result + } +} + +internal fun KMRenderConfigInterface.asPlatform(): RenderConfigInterface = nativeHandle as RenderConfigInterface +public fun RenderConfigInterface.asKmp(): KMRenderConfigInterface = KMRenderConfigInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderLineDescription.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderLineDescription.kt new file mode 100644 index 000000000..758b1a436 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderLineDescription.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMRenderLineDescription = io.openmobilemaps.mapscore.shared.graphics.objects.RenderLineDescription + +internal fun KMRenderLineDescription.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.objects.RenderLineDescription = this +public fun io.openmobilemaps.mapscore.shared.graphics.objects.RenderLineDescription.asKmp(): KMRenderLineDescription = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderObjectInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderObjectInterface.kt new file mode 100644 index 000000000..5f5a1bfdb --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderObjectInterface.kt @@ -0,0 +1,94 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.RenderObjectInterface + +actual interface KMRenderObjectInterface +{ + + actual fun getGraphicsObject(): KMGraphicsObjectInterface + + actual fun hasCustomModelMatrix(): Boolean + + actual fun isScreenSpaceCoords(): Boolean + + actual fun getCustomModelMatrix(): ArrayList + + actual fun setHidden(hidden: Boolean) + + actual fun isHidden(): Boolean +} + +private class KMRenderObjectInterfacePlatformWrapper(internal val nativeHandle: RenderObjectInterface) : KMRenderObjectInterface +{ + + override fun getGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.getGraphicsObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface).asKmp() + } + + override fun hasCustomModelMatrix(): Boolean { + val result = nativeHandle.hasCustomModelMatrix() + return result + } + + override fun isScreenSpaceCoords(): Boolean { + val result = nativeHandle.isScreenSpaceCoords() + return result + } + + override fun getCustomModelMatrix(): ArrayList { + val result = nativeHandle.getCustomModelMatrix() + return ArrayList(result.map { it }) + } + + override fun setHidden(hidden: Boolean) { + nativeHandle.setHidden(hidden) + } + + override fun isHidden(): Boolean { + val result = nativeHandle.isHidden() + return result + } +} + +private class KMRenderObjectInterfacePlatformProxy(private val delegate: KMRenderObjectInterface) : RenderObjectInterface() +{ + + override fun getGraphicsObject(): io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface { + val result = delegate.getGraphicsObject() + return result.asPlatform() + } + + override fun hasCustomModelMatrix(): Boolean { + val result = delegate.hasCustomModelMatrix() + return result + } + + override fun isScreenSpaceCoords(): Boolean { + val result = delegate.isScreenSpaceCoords() + return result + } + + override fun getCustomModelMatrix(): ArrayList { + val result = delegate.getCustomModelMatrix() + return ArrayList(result.map { it }) + } + + override fun setHidden(hidden: Boolean) { + delegate.setHidden(hidden) + } + + override fun isHidden(): Boolean { + val result = delegate.isHidden() + return result + } +} + +internal fun KMRenderObjectInterface.asPlatform(): RenderObjectInterface = when (this) { + is KMRenderObjectInterfacePlatformWrapper -> this.nativeHandle + else -> KMRenderObjectInterfacePlatformProxy(this) +} +public fun RenderObjectInterface.asKmp(): KMRenderObjectInterface = KMRenderObjectInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassConfig.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassConfig.kt new file mode 100644 index 000000000..1defc5c67 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassConfig.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +actual class KMRenderPassConfig actual public constructor( + renderPassIndex: Int, + isPassMasked: Boolean, + renderTarget: KMRenderTargetInterface?, +) { + actual val renderPassIndex: Int = renderPassIndex + actual val isPassMasked: Boolean = isPassMasked + actual val renderTarget: KMRenderTargetInterface? = renderTarget +} + +internal fun KMRenderPassConfig.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.RenderPassConfig = io.openmobilemaps.mapscore.shared.graphics.RenderPassConfig( + renderPassIndex = renderPassIndex, + isPassMasked = isPassMasked, + renderTarget = renderTarget?.let { it.asPlatform() }, +) +public fun io.openmobilemaps.mapscore.shared.graphics.RenderPassConfig.asKmp(): KMRenderPassConfig = KMRenderPassConfig( + renderPassIndex = this.renderPassIndex, + isPassMasked = this.isPassMasked, + renderTarget = this.renderTarget?.let { (it as io.openmobilemaps.mapscore.shared.graphics.RenderTargetInterface).asKmp() }, +) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassInterface.kt new file mode 100644 index 000000000..8ebf562e6 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassInterface.kt @@ -0,0 +1,82 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.RenderPassInterface + +actual interface KMRenderPassInterface +{ + + actual fun getRenderObjects(): ArrayList + + actual fun addRenderObject(renderObject: KMRenderObjectInterface) + + actual fun getRenderPassConfig(): KMRenderPassConfig + + actual fun getMaskingObject(): KMMaskingObjectInterface? + + actual fun getScissoringRect(): KMRectI? +} + +private class KMRenderPassInterfacePlatformWrapper(internal val nativeHandle: RenderPassInterface) : KMRenderPassInterface +{ + + override fun getRenderObjects(): ArrayList { + val result = nativeHandle.getRenderObjects() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.graphics.RenderObjectInterface).asKmp() }) + } + + override fun addRenderObject(renderObject: KMRenderObjectInterface) { + nativeHandle.addRenderObject(renderObject.asPlatform()) + } + + override fun getRenderPassConfig(): KMRenderPassConfig { + val result = nativeHandle.getRenderPassConfig() + return (result as io.openmobilemaps.mapscore.shared.graphics.RenderPassConfig).asKmp() + } + + override fun getMaskingObject(): KMMaskingObjectInterface? { + val result = nativeHandle.getMaskingObject() + return result?.let { (it as io.openmobilemaps.mapscore.shared.graphics.objects.MaskingObjectInterface).asKmp() } + } + + override fun getScissoringRect(): KMRectI? { + val result = nativeHandle.getScissoringRect() + return result?.let { (it as io.openmobilemaps.mapscore.shared.graphics.common.RectI).asKmp() } + } +} + +private class KMRenderPassInterfacePlatformProxy(private val delegate: KMRenderPassInterface) : RenderPassInterface() +{ + + override fun getRenderObjects(): ArrayList { + val result = delegate.getRenderObjects() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun addRenderObject(renderObject: io.openmobilemaps.mapscore.shared.graphics.RenderObjectInterface) { + delegate.addRenderObject((renderObject as io.openmobilemaps.mapscore.shared.graphics.RenderObjectInterface).asKmp()) + } + + override fun getRenderPassConfig(): io.openmobilemaps.mapscore.shared.graphics.RenderPassConfig { + val result = delegate.getRenderPassConfig() + return result.asPlatform() + } + + override fun getMaskingObject(): io.openmobilemaps.mapscore.shared.graphics.objects.MaskingObjectInterface? { + val result = delegate.getMaskingObject() + return result?.let { it.asPlatform() } + } + + override fun getScissoringRect(): io.openmobilemaps.mapscore.shared.graphics.common.RectI? { + val result = delegate.getScissoringRect() + return result?.let { it.asPlatform() } + } +} + +internal fun KMRenderPassInterface.asPlatform(): RenderPassInterface = when (this) { + is KMRenderPassInterfacePlatformWrapper -> this.nativeHandle + else -> KMRenderPassInterfacePlatformProxy(this) +} +public fun RenderPassInterface.asKmp(): KMRenderPassInterface = KMRenderPassInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderTargetInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderTargetInterface.kt new file mode 100644 index 000000000..7cfbe3936 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderTargetInterface.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.RenderTargetInterface + +actual interface KMRenderTargetInterface +{ + + actual fun asGlRenderTargetInterface(): KMOpenGlRenderTargetInterface? +} + +private class KMRenderTargetInterfacePlatformWrapper(internal val nativeHandle: RenderTargetInterface) : KMRenderTargetInterface +{ + + override fun asGlRenderTargetInterface(): KMOpenGlRenderTargetInterface? { + val result = nativeHandle.asGlRenderTargetInterface() + return result?.let { (it as io.openmobilemaps.mapscore.shared.graphics.OpenGlRenderTargetInterface).asKmp() } + } +} + +private class KMRenderTargetInterfacePlatformProxy(private val delegate: KMRenderTargetInterface) : RenderTargetInterface() +{ + + override fun asGlRenderTargetInterface(): io.openmobilemaps.mapscore.shared.graphics.OpenGlRenderTargetInterface? { + val result = delegate.asGlRenderTargetInterface() + return result?.let { it.asPlatform() } + } +} + +internal fun KMRenderTargetInterface.asPlatform(): RenderTargetInterface = when (this) { + is KMRenderTargetInterfacePlatformWrapper -> this.nativeHandle + else -> KMRenderTargetInterfacePlatformProxy(this) +} +public fun RenderTargetInterface.asKmp(): KMRenderTargetInterface = KMRenderTargetInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderVerticesDescription.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderVerticesDescription.kt new file mode 100644 index 000000000..bb4485fc7 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderVerticesDescription.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMRenderVerticesDescription = io.openmobilemaps.mapscore.shared.graphics.objects.RenderVerticesDescription + +internal fun KMRenderVerticesDescription.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.objects.RenderVerticesDescription = this +public fun io.openmobilemaps.mapscore.shared.graphics.objects.RenderVerticesDescription.asKmp(): KMRenderVerticesDescription = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRendererInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRendererInterface.kt new file mode 100644 index 000000000..46f381c5d --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRendererInterface.kt @@ -0,0 +1,64 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.RendererInterface + +actual interface KMRendererInterface +{ + + actual fun addToRenderQueue(renderPass: KMRenderPassInterface) + + actual fun addToComputeQueue(computePass: KMComputePassInterface) + + actual fun drawFrame(renderingContext: KMRenderingContextInterface, camera: KMCameraInterface, target: KMRenderTargetInterface?) + + actual fun compute(renderingContext: KMRenderingContextInterface, camera: KMCameraInterface) +} + +private class KMRendererInterfacePlatformWrapper(internal val nativeHandle: RendererInterface) : KMRendererInterface +{ + + override fun addToRenderQueue(renderPass: KMRenderPassInterface) { + nativeHandle.addToRenderQueue(renderPass.asPlatform()) + } + + override fun addToComputeQueue(computePass: KMComputePassInterface) { + nativeHandle.addToComputeQueue(computePass.asPlatform()) + } + + override fun drawFrame(renderingContext: KMRenderingContextInterface, camera: KMCameraInterface, target: KMRenderTargetInterface?) { + nativeHandle.drawFrame(renderingContext.asPlatform(), camera.asPlatform(), target?.let { it.asPlatform() }) + } + + override fun compute(renderingContext: KMRenderingContextInterface, camera: KMCameraInterface) { + nativeHandle.compute(renderingContext.asPlatform(), camera.asPlatform()) + } +} + +private class KMRendererInterfacePlatformProxy(private val delegate: KMRendererInterface) : RendererInterface() +{ + + override fun addToRenderQueue(renderPass: io.openmobilemaps.mapscore.shared.graphics.RenderPassInterface) { + delegate.addToRenderQueue((renderPass as io.openmobilemaps.mapscore.shared.graphics.RenderPassInterface).asKmp()) + } + + override fun addToComputeQueue(computePass: io.openmobilemaps.mapscore.shared.graphics.ComputePassInterface) { + delegate.addToComputeQueue((computePass as io.openmobilemaps.mapscore.shared.graphics.ComputePassInterface).asKmp()) + } + + override fun drawFrame(renderingContext: io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface, camera: io.openmobilemaps.mapscore.shared.graphics.CameraInterface, target: io.openmobilemaps.mapscore.shared.graphics.RenderTargetInterface?) { + delegate.drawFrame((renderingContext as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp(), (camera as io.openmobilemaps.mapscore.shared.graphics.CameraInterface).asKmp(), target?.let { (it as io.openmobilemaps.mapscore.shared.graphics.RenderTargetInterface).asKmp() }) + } + + override fun compute(renderingContext: io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface, camera: io.openmobilemaps.mapscore.shared.graphics.CameraInterface) { + delegate.compute((renderingContext as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp(), (camera as io.openmobilemaps.mapscore.shared.graphics.CameraInterface).asKmp()) + } +} + +internal fun KMRendererInterface.asPlatform(): RendererInterface = when (this) { + is KMRendererInterfacePlatformWrapper -> this.nativeHandle + else -> KMRendererInterfacePlatformProxy(this) +} +public fun RendererInterface.asKmp(): KMRendererInterface = KMRendererInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingContextInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingContextInterface.kt new file mode 100644 index 000000000..70a96f483 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingContextInterface.kt @@ -0,0 +1,128 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface + +actual interface KMRenderingContextInterface +{ + + actual fun onSurfaceCreated() + + actual fun setViewportSize(size: KMVec2I) + + actual fun getViewportSize(): KMVec2I + + actual fun setBackgroundColor(color: KMColor) + + actual fun setCulling(mode: KMRenderingCullMode) + + actual fun setupDrawFrame(vpMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double) + + actual fun preRenderStencilMask() + + actual fun postRenderStencilMask() + + actual fun applyScissorRect(scissorRect: KMRectI?) + + actual fun asOpenGlRenderingContext(): KMOpenGlRenderingContextInterface? +} + +private class KMRenderingContextInterfacePlatformWrapper(internal val nativeHandle: RenderingContextInterface) : KMRenderingContextInterface +{ + + override fun onSurfaceCreated() { + nativeHandle.onSurfaceCreated() + } + + override fun setViewportSize(size: KMVec2I) { + nativeHandle.setViewportSize(size.asPlatform()) + } + + override fun getViewportSize(): KMVec2I { + val result = nativeHandle.getViewportSize() + return (result as io.openmobilemaps.mapscore.shared.graphics.common.Vec2I).asKmp() + } + + override fun setBackgroundColor(color: KMColor) { + nativeHandle.setBackgroundColor(color.asPlatform()) + } + + override fun setCulling(mode: KMRenderingCullMode) { + nativeHandle.setCulling(mode.asPlatform()) + } + + override fun setupDrawFrame(vpMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double) { + nativeHandle.setupDrawFrame(vpMatrix, origin.asPlatform(), screenPixelAsRealMeterFactor) + } + + override fun preRenderStencilMask() { + nativeHandle.preRenderStencilMask() + } + + override fun postRenderStencilMask() { + nativeHandle.postRenderStencilMask() + } + + override fun applyScissorRect(scissorRect: KMRectI?) { + nativeHandle.applyScissorRect(scissorRect?.let { it.asPlatform() }) + } + + override fun asOpenGlRenderingContext(): KMOpenGlRenderingContextInterface? { + val result = nativeHandle.asOpenGlRenderingContext() + return result?.let { (it as io.openmobilemaps.mapscore.shared.graphics.OpenGlRenderingContextInterface).asKmp() } + } +} + +private class KMRenderingContextInterfacePlatformProxy(private val delegate: KMRenderingContextInterface) : RenderingContextInterface() +{ + + override fun onSurfaceCreated() { + delegate.onSurfaceCreated() + } + + override fun setViewportSize(size: io.openmobilemaps.mapscore.shared.graphics.common.Vec2I) { + delegate.setViewportSize((size as io.openmobilemaps.mapscore.shared.graphics.common.Vec2I).asKmp()) + } + + override fun getViewportSize(): io.openmobilemaps.mapscore.shared.graphics.common.Vec2I { + val result = delegate.getViewportSize() + return result.asPlatform() + } + + override fun setBackgroundColor(color: io.openmobilemaps.mapscore.shared.graphics.common.Color) { + delegate.setBackgroundColor((color as io.openmobilemaps.mapscore.shared.graphics.common.Color).asKmp()) + } + + override fun setCulling(mode: io.openmobilemaps.mapscore.shared.graphics.RenderingCullMode) { + delegate.setCulling((mode as io.openmobilemaps.mapscore.shared.graphics.RenderingCullMode).asKmp()) + } + + override fun setupDrawFrame(vpMatrix: Long, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D, screenPixelAsRealMeterFactor: Double) { + delegate.setupDrawFrame(vpMatrix, (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp(), screenPixelAsRealMeterFactor) + } + + override fun preRenderStencilMask() { + delegate.preRenderStencilMask() + } + + override fun postRenderStencilMask() { + delegate.postRenderStencilMask() + } + + override fun applyScissorRect(scissorRect: io.openmobilemaps.mapscore.shared.graphics.common.RectI?) { + delegate.applyScissorRect(scissorRect?.let { (it as io.openmobilemaps.mapscore.shared.graphics.common.RectI).asKmp() }) + } + + override fun asOpenGlRenderingContext(): io.openmobilemaps.mapscore.shared.graphics.OpenGlRenderingContextInterface? { + val result = delegate.asOpenGlRenderingContext() + return result?.let { it.asPlatform() } + } +} + +internal fun KMRenderingContextInterface.asPlatform(): RenderingContextInterface = when (this) { + is KMRenderingContextInterfacePlatformWrapper -> this.nativeHandle + else -> KMRenderingContextInterfacePlatformProxy(this) +} +public fun RenderingContextInterface.asKmp(): KMRenderingContextInterface = KMRenderingContextInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingCullMode.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingCullMode.kt new file mode 100644 index 000000000..cab873613 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingCullMode.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMRenderingCullMode = io.openmobilemaps.mapscore.shared.graphics.RenderingCullMode + +internal fun KMRenderingCullMode.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.RenderingCullMode = this +public fun io.openmobilemaps.mapscore.shared.graphics.RenderingCullMode.asKmp(): KMRenderingCullMode = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMReverseGeocoderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMReverseGeocoderInterface.kt new file mode 100644 index 000000000..cee55ef36 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMReverseGeocoderInterface.kt @@ -0,0 +1,35 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from reverse_geocoder.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.utils.ReverseGeocoderInterface + +actual class KMReverseGeocoderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as ReverseGeocoderInterface + + actual fun reverseGeocode(coord: KMCoord, thresholdMeters: Long): ArrayList { + val result = native.reverseGeocode(coord.asPlatform(), thresholdMeters) + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureCoordInfo).asKmp() }) + } + + actual fun reverseGeocodeClosest(coord: KMCoord, thresholdMeters: Long): KMVectorLayerFeatureCoordInfo? { + val result = native.reverseGeocodeClosest(coord.asPlatform(), thresholdMeters) + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureCoordInfo).asKmp() } + } + + actual companion object + { + + actual fun create(loader: KMLoaderInterface, tileUrlTemplate: String, zoomLevel: Int): KMReverseGeocoderInterface { + val result = ReverseGeocoderInterface.create(loader.asPlatform(), tileUrlTemplate, zoomLevel) + return (result as io.openmobilemaps.mapscore.shared.utils.ReverseGeocoderInterface).asKmp() + } + } +} + +internal fun KMReverseGeocoderInterface.asPlatform(): ReverseGeocoderInterface = nativeHandle as ReverseGeocoderInterface +public fun ReverseGeocoderInterface.asKmp(): KMReverseGeocoderInterface = KMReverseGeocoderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneCallbackInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneCallbackInterface.kt new file mode 100644 index 000000000..4ed15db80 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneCallbackInterface.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.SceneCallbackInterface + +actual interface KMSceneCallbackInterface +{ + + actual fun invalidate() +} + +private class KMSceneCallbackInterfacePlatformWrapper(internal val nativeHandle: SceneCallbackInterface) : KMSceneCallbackInterface +{ + + override fun invalidate() { + nativeHandle.invalidate() + } +} + +private class KMSceneCallbackInterfacePlatformProxy(private val delegate: KMSceneCallbackInterface) : SceneCallbackInterface() +{ + + override fun invalidate() { + delegate.invalidate() + } +} + +internal fun KMSceneCallbackInterface.asPlatform(): SceneCallbackInterface = when (this) { + is KMSceneCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMSceneCallbackInterfacePlatformProxy(this) +} +public fun SceneCallbackInterface.asKmp(): KMSceneCallbackInterface = KMSceneCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneInterface.kt new file mode 100644 index 000000000..fba733939 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneInterface.kt @@ -0,0 +1,83 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.SceneInterface + +actual class KMSceneInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as SceneInterface + + actual fun setCallbackHandler(callbackInterface: KMSceneCallbackInterface) { + native.setCallbackHandler(callbackInterface.asPlatform()) + } + + actual fun setCamera(camera: KMCameraInterface) { + native.setCamera(camera.asPlatform()) + } + + actual fun getCamera(): KMCameraInterface { + val result = native.getCamera() + return (result as io.openmobilemaps.mapscore.shared.graphics.CameraInterface).asKmp() + } + + actual fun getRenderer(): KMRendererInterface { + val result = native.getRenderer() + return (result as io.openmobilemaps.mapscore.shared.graphics.RendererInterface).asKmp() + } + + actual fun getRenderingContext(): KMRenderingContextInterface { + val result = native.getRenderingContext() + return (result as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp() + } + + actual fun getGraphicsFactory(): KMGraphicsObjectFactoryInterface { + val result = native.getGraphicsFactory() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectFactoryInterface).asKmp() + } + + actual fun getShaderFactory(): KMShaderFactoryInterface { + val result = native.getShaderFactory() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderFactoryInterface).asKmp() + } + + actual fun prepare() { + native.prepare() + } + + actual fun drawFrame(target: KMRenderTargetInterface?) { + native.drawFrame(target?.let { it.asPlatform() }) + } + + actual fun compute() { + native.compute() + } + + actual fun clear() { + native.clear() + } + + actual fun invalidate() { + native.invalidate() + } + + actual companion object + { + + actual fun create(graphicsFactory: KMGraphicsObjectFactoryInterface, shaderFactory: KMShaderFactoryInterface, renderingContext: KMRenderingContextInterface): KMSceneInterface { + val result = SceneInterface.create(graphicsFactory.asPlatform(), shaderFactory.asPlatform(), renderingContext.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.graphics.SceneInterface).asKmp() + } + + actual fun createWithOpenGl(): KMSceneInterface { + val result = SceneInterface.createWithOpenGl() + return (result as io.openmobilemaps.mapscore.shared.graphics.SceneInterface).asKmp() + } + } +} + +internal fun KMSceneInterface.asPlatform(): SceneInterface = nativeHandle as SceneInterface +public fun SceneInterface.asKmp(): KMSceneInterface = KMSceneInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerGraphicsTaskCallbacks.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerGraphicsTaskCallbacks.kt new file mode 100644 index 000000000..928de7a35 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerGraphicsTaskCallbacks.kt @@ -0,0 +1,20 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.scheduling.SchedulerGraphicsTaskCallbacks + +actual class KMSchedulerGraphicsTaskCallbacks actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as SchedulerGraphicsTaskCallbacks + + actual fun requestGraphicsTaskExecution() { + native.requestGraphicsTaskExecution() + } +} + +internal fun KMSchedulerGraphicsTaskCallbacks.asPlatform(): SchedulerGraphicsTaskCallbacks = nativeHandle as SchedulerGraphicsTaskCallbacks +public fun SchedulerGraphicsTaskCallbacks.asKmp(): KMSchedulerGraphicsTaskCallbacks = KMSchedulerGraphicsTaskCallbacks(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerInterface.kt new file mode 100644 index 000000000..a3961b729 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerInterface.kt @@ -0,0 +1,128 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.scheduling.SchedulerInterface + +actual interface KMSchedulerInterface +{ + + actual fun addTask(task: KMTaskInterface) + + actual fun addTasks(tasks: ArrayList) + + actual fun removeTask(id: String) + + actual fun clear() + + actual fun pause() + + actual fun resume() + + actual fun destroy() + + actual fun hasSeparateGraphicsInvocation(): Boolean + + actual fun runGraphicsTasks(): Boolean + + actual fun setSchedulerGraphicsTaskCallbacks(callbacks: KMSchedulerGraphicsTaskCallbacks) +} + +private class KMSchedulerInterfacePlatformWrapper(internal val nativeHandle: SchedulerInterface) : KMSchedulerInterface +{ + + override fun addTask(task: KMTaskInterface) { + nativeHandle.addTask(task.asPlatform()) + } + + override fun addTasks(tasks: ArrayList) { + nativeHandle.addTasks(ArrayList(tasks.map { it.asPlatform() })) + } + + override fun removeTask(id: String) { + nativeHandle.removeTask(id) + } + + override fun clear() { + nativeHandle.clear() + } + + override fun pause() { + nativeHandle.pause() + } + + override fun resume() { + nativeHandle.resume() + } + + override fun destroy() { + nativeHandle.destroy() + } + + override fun hasSeparateGraphicsInvocation(): Boolean { + val result = nativeHandle.hasSeparateGraphicsInvocation() + return result + } + + override fun runGraphicsTasks(): Boolean { + val result = nativeHandle.runGraphicsTasks() + return result + } + + override fun setSchedulerGraphicsTaskCallbacks(callbacks: KMSchedulerGraphicsTaskCallbacks) { + nativeHandle.setSchedulerGraphicsTaskCallbacks(callbacks.asPlatform()) + } +} + +private class KMSchedulerInterfacePlatformProxy(private val delegate: KMSchedulerInterface) : SchedulerInterface() +{ + + override fun addTask(task: io.openmobilemaps.mapscore.shared.map.scheduling.TaskInterface) { + delegate.addTask((task as io.openmobilemaps.mapscore.shared.map.scheduling.TaskInterface).asKmp()) + } + + override fun addTasks(tasks: ArrayList) { + delegate.addTasks(ArrayList(tasks.map { (it as io.openmobilemaps.mapscore.shared.map.scheduling.TaskInterface).asKmp() })) + } + + override fun removeTask(id: String) { + delegate.removeTask(id) + } + + override fun clear() { + delegate.clear() + } + + override fun pause() { + delegate.pause() + } + + override fun resume() { + delegate.resume() + } + + override fun destroy() { + delegate.destroy() + } + + override fun hasSeparateGraphicsInvocation(): Boolean { + val result = delegate.hasSeparateGraphicsInvocation() + return result + } + + override fun runGraphicsTasks(): Boolean { + val result = delegate.runGraphicsTasks() + return result + } + + override fun setSchedulerGraphicsTaskCallbacks(callbacks: io.openmobilemaps.mapscore.shared.map.scheduling.SchedulerGraphicsTaskCallbacks) { + delegate.setSchedulerGraphicsTaskCallbacks((callbacks as io.openmobilemaps.mapscore.shared.map.scheduling.SchedulerGraphicsTaskCallbacks).asKmp()) + } +} + +internal fun KMSchedulerInterface.asPlatform(): SchedulerInterface = when (this) { + is KMSchedulerInterfacePlatformWrapper -> this.nativeHandle + else -> KMSchedulerInterfacePlatformProxy(this) +} +public fun SchedulerInterface.asKmp(): KMSchedulerInterface = KMSchedulerInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderFactoryInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderFactoryInterface.kt new file mode 100644 index 000000000..f1b2b1900 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderFactoryInterface.kt @@ -0,0 +1,348 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.ShaderFactoryInterface + +actual interface KMShaderFactoryInterface +{ + + actual fun createAlphaShader(): KMAlphaShaderInterface + + actual fun createUnitSphereAlphaShader(): KMAlphaShaderInterface + + actual fun createAlphaInstancedShader(): KMAlphaInstancedShaderInterface + + actual fun createUnitSphereAlphaInstancedShader(): KMAlphaInstancedShaderInterface + + actual fun createLineGroupShader(): KMLineGroupShaderInterface + + actual fun createUnitSphereLineGroupShader(): KMLineGroupShaderInterface + + actual fun createSimpleLineGroupShader(): KMLineGroupShaderInterface + + actual fun createUnitSphereSimpleLineGroupShader(): KMLineGroupShaderInterface + + actual fun createUnitSphereColorShader(): KMColorShaderInterface + + actual fun createColorShader(): KMColorShaderInterface + + actual fun createPolygonTessellatedShader(unitSphere: Boolean): KMColorShaderInterface + + actual fun createColorCircleShader(): KMColorCircleShaderInterface + + actual fun createUnitSphereColorCircleShader(): KMColorCircleShaderInterface + + actual fun createPolygonGroupShader(isStriped: Boolean, unitSphere: Boolean): KMPolygonGroupShaderInterface + + actual fun createPolygonPatternGroupShader(fadeInPattern: Boolean, unitSphere: Boolean): KMPolygonPatternGroupShaderInterface + + actual fun createTextShader(): KMTextShaderInterface + + actual fun createTextInstancedShader(): KMTextInstancedShaderInterface + + actual fun createUnitSphereTextInstancedShader(): KMTextInstancedShaderInterface + + actual fun createRasterShader(): KMRasterShaderInterface + + actual fun createUnitSphereRasterShader(): KMRasterShaderInterface + + actual fun createQuadTessellatedShader(): KMRasterShaderInterface + + actual fun createStretchShader(): KMStretchShaderInterface + + actual fun createStretchInstancedShader(unitSphere: Boolean): KMStretchInstancedShaderInterface + + actual fun createIcosahedronColorShader(): KMColorShaderInterface + + actual fun createSphereEffectShader(): KMSphereEffectShaderInterface + + actual fun createSkySphereShader(): KMSkySphereShaderInterface + + actual fun createElevationInterpolationShader(): KMElevationInterpolationShaderInterface +} + +private class KMShaderFactoryInterfacePlatformWrapper(internal val nativeHandle: ShaderFactoryInterface) : KMShaderFactoryInterface +{ + + override fun createAlphaShader(): KMAlphaShaderInterface { + val result = nativeHandle.createAlphaShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.AlphaShaderInterface).asKmp() + } + + override fun createUnitSphereAlphaShader(): KMAlphaShaderInterface { + val result = nativeHandle.createUnitSphereAlphaShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.AlphaShaderInterface).asKmp() + } + + override fun createAlphaInstancedShader(): KMAlphaInstancedShaderInterface { + val result = nativeHandle.createAlphaInstancedShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.AlphaInstancedShaderInterface).asKmp() + } + + override fun createUnitSphereAlphaInstancedShader(): KMAlphaInstancedShaderInterface { + val result = nativeHandle.createUnitSphereAlphaInstancedShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.AlphaInstancedShaderInterface).asKmp() + } + + override fun createLineGroupShader(): KMLineGroupShaderInterface { + val result = nativeHandle.createLineGroupShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.LineGroupShaderInterface).asKmp() + } + + override fun createUnitSphereLineGroupShader(): KMLineGroupShaderInterface { + val result = nativeHandle.createUnitSphereLineGroupShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.LineGroupShaderInterface).asKmp() + } + + override fun createSimpleLineGroupShader(): KMLineGroupShaderInterface { + val result = nativeHandle.createSimpleLineGroupShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.LineGroupShaderInterface).asKmp() + } + + override fun createUnitSphereSimpleLineGroupShader(): KMLineGroupShaderInterface { + val result = nativeHandle.createUnitSphereSimpleLineGroupShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.LineGroupShaderInterface).asKmp() + } + + override fun createUnitSphereColorShader(): KMColorShaderInterface { + val result = nativeHandle.createUnitSphereColorShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ColorShaderInterface).asKmp() + } + + override fun createColorShader(): KMColorShaderInterface { + val result = nativeHandle.createColorShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ColorShaderInterface).asKmp() + } + + override fun createPolygonTessellatedShader(unitSphere: Boolean): KMColorShaderInterface { + val result = nativeHandle.createPolygonTessellatedShader(unitSphere) + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ColorShaderInterface).asKmp() + } + + override fun createColorCircleShader(): KMColorCircleShaderInterface { + val result = nativeHandle.createColorCircleShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ColorCircleShaderInterface).asKmp() + } + + override fun createUnitSphereColorCircleShader(): KMColorCircleShaderInterface { + val result = nativeHandle.createUnitSphereColorCircleShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ColorCircleShaderInterface).asKmp() + } + + override fun createPolygonGroupShader(isStriped: Boolean, unitSphere: Boolean): KMPolygonGroupShaderInterface { + val result = nativeHandle.createPolygonGroupShader(isStriped, unitSphere) + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.PolygonGroupShaderInterface).asKmp() + } + + override fun createPolygonPatternGroupShader(fadeInPattern: Boolean, unitSphere: Boolean): KMPolygonPatternGroupShaderInterface { + val result = nativeHandle.createPolygonPatternGroupShader(fadeInPattern, unitSphere) + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.PolygonPatternGroupShaderInterface).asKmp() + } + + override fun createTextShader(): KMTextShaderInterface { + val result = nativeHandle.createTextShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.TextShaderInterface).asKmp() + } + + override fun createTextInstancedShader(): KMTextInstancedShaderInterface { + val result = nativeHandle.createTextInstancedShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.TextInstancedShaderInterface).asKmp() + } + + override fun createUnitSphereTextInstancedShader(): KMTextInstancedShaderInterface { + val result = nativeHandle.createUnitSphereTextInstancedShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.TextInstancedShaderInterface).asKmp() + } + + override fun createRasterShader(): KMRasterShaderInterface { + val result = nativeHandle.createRasterShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.RasterShaderInterface).asKmp() + } + + override fun createUnitSphereRasterShader(): KMRasterShaderInterface { + val result = nativeHandle.createUnitSphereRasterShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.RasterShaderInterface).asKmp() + } + + override fun createQuadTessellatedShader(): KMRasterShaderInterface { + val result = nativeHandle.createQuadTessellatedShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.RasterShaderInterface).asKmp() + } + + override fun createStretchShader(): KMStretchShaderInterface { + val result = nativeHandle.createStretchShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.StretchShaderInterface).asKmp() + } + + override fun createStretchInstancedShader(unitSphere: Boolean): KMStretchInstancedShaderInterface { + val result = nativeHandle.createStretchInstancedShader(unitSphere) + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.StretchInstancedShaderInterface).asKmp() + } + + override fun createIcosahedronColorShader(): KMColorShaderInterface { + val result = nativeHandle.createIcosahedronColorShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ColorShaderInterface).asKmp() + } + + override fun createSphereEffectShader(): KMSphereEffectShaderInterface { + val result = nativeHandle.createSphereEffectShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.SphereEffectShaderInterface).asKmp() + } + + override fun createSkySphereShader(): KMSkySphereShaderInterface { + val result = nativeHandle.createSkySphereShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.SkySphereShaderInterface).asKmp() + } + + override fun createElevationInterpolationShader(): KMElevationInterpolationShaderInterface { + val result = nativeHandle.createElevationInterpolationShader() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ElevationInterpolationShaderInterface).asKmp() + } +} + +private class KMShaderFactoryInterfacePlatformProxy(private val delegate: KMShaderFactoryInterface) : ShaderFactoryInterface() +{ + + override fun createAlphaShader(): io.openmobilemaps.mapscore.shared.graphics.shader.AlphaShaderInterface { + val result = delegate.createAlphaShader() + return result.asPlatform() + } + + override fun createUnitSphereAlphaShader(): io.openmobilemaps.mapscore.shared.graphics.shader.AlphaShaderInterface { + val result = delegate.createUnitSphereAlphaShader() + return result.asPlatform() + } + + override fun createAlphaInstancedShader(): io.openmobilemaps.mapscore.shared.graphics.shader.AlphaInstancedShaderInterface { + val result = delegate.createAlphaInstancedShader() + return result.asPlatform() + } + + override fun createUnitSphereAlphaInstancedShader(): io.openmobilemaps.mapscore.shared.graphics.shader.AlphaInstancedShaderInterface { + val result = delegate.createUnitSphereAlphaInstancedShader() + return result.asPlatform() + } + + override fun createLineGroupShader(): io.openmobilemaps.mapscore.shared.graphics.shader.LineGroupShaderInterface { + val result = delegate.createLineGroupShader() + return result.asPlatform() + } + + override fun createUnitSphereLineGroupShader(): io.openmobilemaps.mapscore.shared.graphics.shader.LineGroupShaderInterface { + val result = delegate.createUnitSphereLineGroupShader() + return result.asPlatform() + } + + override fun createSimpleLineGroupShader(): io.openmobilemaps.mapscore.shared.graphics.shader.LineGroupShaderInterface { + val result = delegate.createSimpleLineGroupShader() + return result.asPlatform() + } + + override fun createUnitSphereSimpleLineGroupShader(): io.openmobilemaps.mapscore.shared.graphics.shader.LineGroupShaderInterface { + val result = delegate.createUnitSphereSimpleLineGroupShader() + return result.asPlatform() + } + + override fun createUnitSphereColorShader(): io.openmobilemaps.mapscore.shared.graphics.shader.ColorShaderInterface { + val result = delegate.createUnitSphereColorShader() + return result.asPlatform() + } + + override fun createColorShader(): io.openmobilemaps.mapscore.shared.graphics.shader.ColorShaderInterface { + val result = delegate.createColorShader() + return result.asPlatform() + } + + override fun createPolygonTessellatedShader(unitSphere: Boolean): io.openmobilemaps.mapscore.shared.graphics.shader.ColorShaderInterface { + val result = delegate.createPolygonTessellatedShader(unitSphere) + return result.asPlatform() + } + + override fun createColorCircleShader(): io.openmobilemaps.mapscore.shared.graphics.shader.ColorCircleShaderInterface { + val result = delegate.createColorCircleShader() + return result.asPlatform() + } + + override fun createUnitSphereColorCircleShader(): io.openmobilemaps.mapscore.shared.graphics.shader.ColorCircleShaderInterface { + val result = delegate.createUnitSphereColorCircleShader() + return result.asPlatform() + } + + override fun createPolygonGroupShader(isStriped: Boolean, unitSphere: Boolean): io.openmobilemaps.mapscore.shared.graphics.shader.PolygonGroupShaderInterface { + val result = delegate.createPolygonGroupShader(isStriped, unitSphere) + return result.asPlatform() + } + + override fun createPolygonPatternGroupShader(fadeInPattern: Boolean, unitSphere: Boolean): io.openmobilemaps.mapscore.shared.graphics.shader.PolygonPatternGroupShaderInterface { + val result = delegate.createPolygonPatternGroupShader(fadeInPattern, unitSphere) + return result.asPlatform() + } + + override fun createTextShader(): io.openmobilemaps.mapscore.shared.graphics.shader.TextShaderInterface { + val result = delegate.createTextShader() + return result.asPlatform() + } + + override fun createTextInstancedShader(): io.openmobilemaps.mapscore.shared.graphics.shader.TextInstancedShaderInterface { + val result = delegate.createTextInstancedShader() + return result.asPlatform() + } + + override fun createUnitSphereTextInstancedShader(): io.openmobilemaps.mapscore.shared.graphics.shader.TextInstancedShaderInterface { + val result = delegate.createUnitSphereTextInstancedShader() + return result.asPlatform() + } + + override fun createRasterShader(): io.openmobilemaps.mapscore.shared.graphics.shader.RasterShaderInterface { + val result = delegate.createRasterShader() + return result.asPlatform() + } + + override fun createUnitSphereRasterShader(): io.openmobilemaps.mapscore.shared.graphics.shader.RasterShaderInterface { + val result = delegate.createUnitSphereRasterShader() + return result.asPlatform() + } + + override fun createQuadTessellatedShader(): io.openmobilemaps.mapscore.shared.graphics.shader.RasterShaderInterface { + val result = delegate.createQuadTessellatedShader() + return result.asPlatform() + } + + override fun createStretchShader(): io.openmobilemaps.mapscore.shared.graphics.shader.StretchShaderInterface { + val result = delegate.createStretchShader() + return result.asPlatform() + } + + override fun createStretchInstancedShader(unitSphere: Boolean): io.openmobilemaps.mapscore.shared.graphics.shader.StretchInstancedShaderInterface { + val result = delegate.createStretchInstancedShader(unitSphere) + return result.asPlatform() + } + + override fun createIcosahedronColorShader(): io.openmobilemaps.mapscore.shared.graphics.shader.ColorShaderInterface { + val result = delegate.createIcosahedronColorShader() + return result.asPlatform() + } + + override fun createSphereEffectShader(): io.openmobilemaps.mapscore.shared.graphics.shader.SphereEffectShaderInterface { + val result = delegate.createSphereEffectShader() + return result.asPlatform() + } + + override fun createSkySphereShader(): io.openmobilemaps.mapscore.shared.graphics.shader.SkySphereShaderInterface { + val result = delegate.createSkySphereShader() + return result.asPlatform() + } + + override fun createElevationInterpolationShader(): io.openmobilemaps.mapscore.shared.graphics.shader.ElevationInterpolationShaderInterface { + val result = delegate.createElevationInterpolationShader() + return result.asPlatform() + } +} + +internal fun KMShaderFactoryInterface.asPlatform(): ShaderFactoryInterface = when (this) { + is KMShaderFactoryInterfacePlatformWrapper -> this.nativeHandle + else -> KMShaderFactoryInterfacePlatformProxy(this) +} +public fun ShaderFactoryInterface.asKmp(): KMShaderFactoryInterface = KMShaderFactoryInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderProgramInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderProgramInterface.kt new file mode 100644 index 000000000..30dcce8b6 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderProgramInterface.kt @@ -0,0 +1,38 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface + +actual class KMShaderProgramInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as ShaderProgramInterface + + actual fun getProgramName(): String { + val result = native.getProgramName() + return result + } + + actual fun setupProgram(context: KMRenderingContextInterface) { + native.setupProgram(context.asPlatform()) + } + + actual fun preRender(context: KMRenderingContextInterface, isScreenSpaceCoords: Boolean) { + native.preRender(context.asPlatform(), isScreenSpaceCoords) + } + + actual fun setBlendMode(blendMode: KMBlendMode) { + native.setBlendMode(blendMode.asPlatform()) + } + + actual fun usesModelMatrix(): Boolean { + val result = native.usesModelMatrix() + return result + } +} + +internal fun KMShaderProgramInterface.asPlatform(): ShaderProgramInterface = nativeHandle as ShaderProgramInterface +public fun ShaderProgramInterface.asKmp(): KMShaderProgramInterface = KMShaderProgramInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSharedBytes.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSharedBytes.kt new file mode 100644 index 000000000..a477fac3b --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSharedBytes.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMSharedBytes = io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes + +internal fun KMSharedBytes.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes.asKmp(): KMSharedBytes = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSizeType.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSizeType.kt new file mode 100644 index 000000000..1288ed8d6 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSizeType.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from styling.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMSizeType = io.openmobilemaps.mapscore.shared.map.layers.SizeType + +internal fun KMSizeType.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.SizeType = this +public fun io.openmobilemaps.mapscore.shared.map.layers.SizeType.asKmp(): KMSizeType = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereLayerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereLayerInterface.kt new file mode 100644 index 000000000..3d5368126 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereLayerInterface.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from sky_sphere.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.skysphere.SkySphereLayerInterface + +actual class KMSkySphereLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as SkySphereLayerInterface + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as io.openmobilemaps.mapscore.shared.map.LayerInterface).asKmp() + } + + actual fun setTexture(texture: KMTextureHolderInterface) { + native.setTexture(texture.asPlatform()) + } + + actual companion object + { + + actual fun create(): KMSkySphereLayerInterface { + val result = SkySphereLayerInterface.create() + return (result as io.openmobilemaps.mapscore.shared.map.layers.skysphere.SkySphereLayerInterface).asKmp() + } + } +} + +internal fun KMSkySphereLayerInterface.asPlatform(): SkySphereLayerInterface = nativeHandle as SkySphereLayerInterface +public fun SkySphereLayerInterface.asKmp(): KMSkySphereLayerInterface = KMSkySphereLayerInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereShaderInterface.kt new file mode 100644 index 000000000..44923b6f7 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereShaderInterface.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.SkySphereShaderInterface + +actual class KMSkySphereShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as SkySphereShaderInterface + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } + + actual fun setCameraProperties(inverseVP: ArrayList, cameraPosition: KMVec3D) { + native.setCameraProperties(ArrayList(inverseVP.map { it }), cameraPosition.asPlatform()) + } +} + +internal fun KMSkySphereShaderInterface.asPlatform(): SkySphereShaderInterface = nativeHandle as SkySphereShaderInterface +public fun SkySphereShaderInterface.asKmp(): KMSkySphereShaderInterface = KMSkySphereShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectLayerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectLayerInterface.kt new file mode 100644 index 000000000..c164c317c --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectLayerInterface.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from sphere_effect.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.effect.SphereEffectLayerInterface + +actual class KMSphereEffectLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as SphereEffectLayerInterface + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as io.openmobilemaps.mapscore.shared.map.LayerInterface).asKmp() + } + + actual companion object + { + + actual fun create(): KMSphereEffectLayerInterface { + val result = SphereEffectLayerInterface.create() + return (result as io.openmobilemaps.mapscore.shared.map.layers.effect.SphereEffectLayerInterface).asKmp() + } + } +} + +internal fun KMSphereEffectLayerInterface.asPlatform(): SphereEffectLayerInterface = nativeHandle as SphereEffectLayerInterface +public fun SphereEffectLayerInterface.asKmp(): KMSphereEffectLayerInterface = KMSphereEffectLayerInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectShaderInterface.kt new file mode 100644 index 000000000..007fa605c --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectShaderInterface.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.SphereEffectShaderInterface + +actual class KMSphereEffectShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as SphereEffectShaderInterface + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } + + actual fun setEllipse(coefficients: KMSharedBytes) { + native.setEllipse(coefficients.asPlatform()) + } +} + +internal fun KMSphereEffectShaderInterface.asPlatform(): SphereEffectShaderInterface = nativeHandle as SphereEffectShaderInterface +public fun SphereEffectShaderInterface.asKmp(): KMSphereEffectShaderInterface = KMSphereEffectShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchInstancedShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchInstancedShaderInterface.kt new file mode 100644 index 000000000..da85a6154 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchInstancedShaderInterface.kt @@ -0,0 +1,21 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.StretchInstancedShaderInterface + +actual class KMStretchInstancedShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as StretchInstancedShaderInterface + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } +} + +internal fun KMStretchInstancedShaderInterface.asPlatform(): StretchInstancedShaderInterface = nativeHandle as StretchInstancedShaderInterface +public fun StretchInstancedShaderInterface.asKmp(): KMStretchInstancedShaderInterface = KMStretchInstancedShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInfo.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInfo.kt new file mode 100644 index 000000000..700bf5118 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInfo.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMStretchShaderInfo = io.openmobilemaps.mapscore.shared.graphics.shader.StretchShaderInfo + +internal fun KMStretchShaderInfo.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.shader.StretchShaderInfo = this +public fun io.openmobilemaps.mapscore.shared.graphics.shader.StretchShaderInfo.asKmp(): KMStretchShaderInfo = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInterface.kt new file mode 100644 index 000000000..093401d0d --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInterface.kt @@ -0,0 +1,29 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.StretchShaderInterface + +actual class KMStretchShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as StretchShaderInterface + + actual fun updateAlpha(value: Float) { + native.updateAlpha(value) + } + + actual fun updateStretchInfo(info: KMStretchShaderInfo) { + native.updateStretchInfo(info.asPlatform()) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } +} + +internal fun KMStretchShaderInterface.asPlatform(): StretchShaderInterface = nativeHandle as StretchShaderInterface +public fun StretchShaderInterface.asKmp(): KMStretchShaderInterface = KMStretchShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolAlignment.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolAlignment.kt new file mode 100644 index 000000000..91f628377 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolAlignment.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMSymbolAlignment = io.openmobilemaps.mapscore.shared.map.layers.text.SymbolAlignment + +internal fun KMSymbolAlignment.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.text.SymbolAlignment = this +public fun io.openmobilemaps.mapscore.shared.map.layers.text.SymbolAlignment.asKmp(): KMSymbolAlignment = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolZOrder.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolZOrder.kt new file mode 100644 index 000000000..8372c2d39 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolZOrder.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMSymbolZOrder = io.openmobilemaps.mapscore.shared.map.layers.text.SymbolZOrder + +internal fun KMSymbolZOrder.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.text.SymbolZOrder = this +public fun io.openmobilemaps.mapscore.shared.map.layers.text.SymbolZOrder.asKmp(): KMSymbolZOrder = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskConfig.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskConfig.kt new file mode 100644 index 000000000..5d438b862 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskConfig.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTaskConfig = io.openmobilemaps.mapscore.shared.map.scheduling.TaskConfig + +internal fun KMTaskConfig.asPlatform(): io.openmobilemaps.mapscore.shared.map.scheduling.TaskConfig = this +public fun io.openmobilemaps.mapscore.shared.map.scheduling.TaskConfig.asKmp(): KMTaskConfig = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskInterface.kt new file mode 100644 index 000000000..fba0204e6 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskInterface.kt @@ -0,0 +1,46 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.scheduling.TaskInterface + +actual interface KMTaskInterface +{ + + actual fun getConfig(): KMTaskConfig + + actual fun run() +} + +private class KMTaskInterfacePlatformWrapper(internal val nativeHandle: TaskInterface) : KMTaskInterface +{ + + override fun getConfig(): KMTaskConfig { + val result = nativeHandle.getConfig() + return (result as io.openmobilemaps.mapscore.shared.map.scheduling.TaskConfig).asKmp() + } + + override fun run() { + nativeHandle.run() + } +} + +private class KMTaskInterfacePlatformProxy(private val delegate: KMTaskInterface) : TaskInterface() +{ + + override fun getConfig(): io.openmobilemaps.mapscore.shared.map.scheduling.TaskConfig { + val result = delegate.getConfig() + return result.asPlatform() + } + + override fun run() { + delegate.run() + } +} + +internal fun KMTaskInterface.asPlatform(): TaskInterface = when (this) { + is KMTaskInterfacePlatformWrapper -> this.nativeHandle + else -> KMTaskInterfacePlatformProxy(this) +} +public fun TaskInterface.asKmp(): KMTaskInterface = KMTaskInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskPriority.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskPriority.kt new file mode 100644 index 000000000..3b33b8259 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskPriority.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTaskPriority = io.openmobilemaps.mapscore.shared.map.scheduling.TaskPriority + +internal fun KMTaskPriority.asPlatform(): io.openmobilemaps.mapscore.shared.map.scheduling.TaskPriority = this +public fun io.openmobilemaps.mapscore.shared.map.scheduling.TaskPriority.asKmp(): KMTaskPriority = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTessellationMode.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTessellationMode.kt new file mode 100644 index 000000000..878c4aa69 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTessellationMode.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTessellationMode = io.openmobilemaps.mapscore.shared.graphics.shader.TessellationMode + +internal fun KMTessellationMode.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.shader.TessellationMode = this +public fun io.openmobilemaps.mapscore.shared.graphics.shader.TessellationMode.asKmp(): KMTessellationMode = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextDescription.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextDescription.kt new file mode 100644 index 000000000..62fc6cb2a --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextDescription.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTextDescription = io.openmobilemaps.mapscore.shared.graphics.objects.TextDescription + +internal fun KMTextDescription.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.objects.TextDescription = this +public fun io.openmobilemaps.mapscore.shared.graphics.objects.TextDescription.asKmp(): KMTextDescription = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextFactory.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextFactory.kt new file mode 100644 index 000000000..b0d58e6e4 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextFactory.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.text.TextFactory + +actual class KMTextFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as TextFactory + + actual companion object + { + + actual fun createText(text: ArrayList, coordinate: KMCoord, font: KMFont, textAnchor: KMAnchor, textJustify: KMTextJustify): KMTextInfoInterface { + val result = TextFactory.createText(ArrayList(text.map { it.asPlatform() }), coordinate.asPlatform(), font.asPlatform(), textAnchor.asPlatform(), textJustify.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.layers.text.TextInfoInterface).asKmp() + } + } +} + +internal fun KMTextFactory.asPlatform(): TextFactory = nativeHandle as TextFactory +public fun TextFactory.asKmp(): KMTextFactory = KMTextFactory(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInfoInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInfoInterface.kt new file mode 100644 index 000000000..5a6473a0d --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInfoInterface.kt @@ -0,0 +1,108 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.text.TextInfoInterface + +actual interface KMTextInfoInterface +{ + + actual fun getText(): ArrayList + + actual fun getCoordinate(): KMCoord + + actual fun getFont(): KMFont + + actual fun getTextAnchor(): KMAnchor + + actual fun getTextJustify(): KMTextJustify + + actual fun getSymbolPlacement(): KMTextSymbolPlacement + + actual fun getLineCoordinates(): ArrayList? +} + +private class KMTextInfoInterfacePlatformWrapper(internal val nativeHandle: TextInfoInterface) : KMTextInfoInterface +{ + + override fun getText(): ArrayList { + val result = nativeHandle.getText() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.layers.text.FormattedStringEntry).asKmp() }) + } + + override fun getCoordinate(): KMCoord { + val result = nativeHandle.getCoordinate() + return (result as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp() + } + + override fun getFont(): KMFont { + val result = nativeHandle.getFont() + return (result as io.openmobilemaps.mapscore.shared.map.loader.Font).asKmp() + } + + override fun getTextAnchor(): KMAnchor { + val result = nativeHandle.getTextAnchor() + return (result as io.openmobilemaps.mapscore.shared.map.layers.text.Anchor).asKmp() + } + + override fun getTextJustify(): KMTextJustify { + val result = nativeHandle.getTextJustify() + return (result as io.openmobilemaps.mapscore.shared.map.layers.text.TextJustify).asKmp() + } + + override fun getSymbolPlacement(): KMTextSymbolPlacement { + val result = nativeHandle.getSymbolPlacement() + return (result as io.openmobilemaps.mapscore.shared.map.layers.text.TextSymbolPlacement).asKmp() + } + + override fun getLineCoordinates(): ArrayList? { + val result = nativeHandle.getLineCoordinates() + return result?.let { ArrayList(it.map { (it as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp() }) } + } +} + +private class KMTextInfoInterfacePlatformProxy(private val delegate: KMTextInfoInterface) : TextInfoInterface() +{ + + override fun getText(): ArrayList { + val result = delegate.getText() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun getCoordinate(): io.openmobilemaps.mapscore.shared.map.coordinates.Coord { + val result = delegate.getCoordinate() + return result.asPlatform() + } + + override fun getFont(): io.openmobilemaps.mapscore.shared.map.loader.Font { + val result = delegate.getFont() + return result.asPlatform() + } + + override fun getTextAnchor(): io.openmobilemaps.mapscore.shared.map.layers.text.Anchor { + val result = delegate.getTextAnchor() + return result.asPlatform() + } + + override fun getTextJustify(): io.openmobilemaps.mapscore.shared.map.layers.text.TextJustify { + val result = delegate.getTextJustify() + return result.asPlatform() + } + + override fun getSymbolPlacement(): io.openmobilemaps.mapscore.shared.map.layers.text.TextSymbolPlacement { + val result = delegate.getSymbolPlacement() + return result.asPlatform() + } + + override fun getLineCoordinates(): ArrayList? { + val result = delegate.getLineCoordinates() + return result?.let { ArrayList(it.map { it.asPlatform() }) } + } +} + +internal fun KMTextInfoInterface.asPlatform(): TextInfoInterface = when (this) { + is KMTextInfoInterfacePlatformWrapper -> this.nativeHandle + else -> KMTextInfoInterfacePlatformProxy(this) +} +public fun TextInfoInterface.asKmp(): KMTextInfoInterface = KMTextInfoInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedInterface.kt new file mode 100644 index 000000000..44603e313 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedInterface.kt @@ -0,0 +1,156 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.TextInstancedInterface + +actual interface KMTextInstancedInterface +{ + + actual fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) + + actual fun setInstanceCount(count: Int) + + actual fun setPositions(positions: KMSharedBytes) + + actual fun setReferencePositions(positions: KMSharedBytes) + + actual fun setTextureCoordinates(textureCoordinates: KMSharedBytes) + + actual fun setScales(scales: KMSharedBytes) + + actual fun setRotations(rotations: KMSharedBytes) + + actual fun setAlphas(alphas: KMSharedBytes) + + actual fun setStyleIndices(indices: KMSharedBytes) + + actual fun setStyles(values: KMSharedBytes) + + actual fun loadFont(context: KMRenderingContextInterface, fontData: KMFontData, fontMsdfTexture: KMTextureHolderInterface) + + actual fun removeTexture() + + actual fun asGraphicsObject(): KMGraphicsObjectInterface +} + +private class KMTextInstancedInterfacePlatformWrapper(internal val nativeHandle: TextInstancedInterface) : KMTextInstancedInterface +{ + + override fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) { + nativeHandle.setFrame(frame.asPlatform(), origin.asPlatform(), is3d) + } + + override fun setInstanceCount(count: Int) { + nativeHandle.setInstanceCount(count) + } + + override fun setPositions(positions: KMSharedBytes) { + nativeHandle.setPositions(positions.asPlatform()) + } + + override fun setReferencePositions(positions: KMSharedBytes) { + nativeHandle.setReferencePositions(positions.asPlatform()) + } + + override fun setTextureCoordinates(textureCoordinates: KMSharedBytes) { + nativeHandle.setTextureCoordinates(textureCoordinates.asPlatform()) + } + + override fun setScales(scales: KMSharedBytes) { + nativeHandle.setScales(scales.asPlatform()) + } + + override fun setRotations(rotations: KMSharedBytes) { + nativeHandle.setRotations(rotations.asPlatform()) + } + + override fun setAlphas(alphas: KMSharedBytes) { + nativeHandle.setAlphas(alphas.asPlatform()) + } + + override fun setStyleIndices(indices: KMSharedBytes) { + nativeHandle.setStyleIndices(indices.asPlatform()) + } + + override fun setStyles(values: KMSharedBytes) { + nativeHandle.setStyles(values.asPlatform()) + } + + override fun loadFont(context: KMRenderingContextInterface, fontData: KMFontData, fontMsdfTexture: KMTextureHolderInterface) { + nativeHandle.loadFont(context.asPlatform(), fontData.asPlatform(), fontMsdfTexture.asPlatform()) + } + + override fun removeTexture() { + nativeHandle.removeTexture() + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface).asKmp() + } +} + +private class KMTextInstancedInterfacePlatformProxy(private val delegate: KMTextInstancedInterface) : TextInstancedInterface() +{ + + override fun setFrame(frame: io.openmobilemaps.mapscore.shared.graphics.common.Quad2dD, origin: io.openmobilemaps.mapscore.shared.graphics.common.Vec3D, is3d: Boolean) { + delegate.setFrame((frame as io.openmobilemaps.mapscore.shared.graphics.common.Quad2dD).asKmp(), (origin as io.openmobilemaps.mapscore.shared.graphics.common.Vec3D).asKmp(), is3d) + } + + override fun setInstanceCount(count: Int) { + delegate.setInstanceCount(count) + } + + override fun setPositions(positions: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setPositions((positions as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setReferencePositions(positions: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setReferencePositions((positions as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setTextureCoordinates(textureCoordinates: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setTextureCoordinates((textureCoordinates as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setScales(scales: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setScales((scales as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setRotations(rotations: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setRotations((rotations as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setAlphas(alphas: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setAlphas((alphas as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setStyleIndices(indices: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setStyleIndices((indices as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun setStyles(values: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setStyles((values as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun loadFont(context: io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface, fontData: io.openmobilemaps.mapscore.shared.map.loader.FontData, fontMsdfTexture: io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface) { + delegate.loadFont((context as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp(), (fontData as io.openmobilemaps.mapscore.shared.map.loader.FontData).asKmp(), (fontMsdfTexture as io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface).asKmp()) + } + + override fun removeTexture() { + delegate.removeTexture() + } + + override fun asGraphicsObject(): io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } +} + +internal fun KMTextInstancedInterface.asPlatform(): TextInstancedInterface = when (this) { + is KMTextInstancedInterfacePlatformWrapper -> this.nativeHandle + else -> KMTextInstancedInterfacePlatformProxy(this) +} +public fun TextInstancedInterface.asKmp(): KMTextInstancedInterface = KMTextInstancedInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedShaderInterface.kt new file mode 100644 index 000000000..687b5e44d --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedShaderInterface.kt @@ -0,0 +1,21 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.TextInstancedShaderInterface + +actual class KMTextInstancedShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as TextInstancedShaderInterface + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } +} + +internal fun KMTextInstancedShaderInterface.asPlatform(): TextInstancedShaderInterface = nativeHandle as TextInstancedShaderInterface +public fun TextInstancedShaderInterface.asKmp(): KMTextInstancedShaderInterface = KMTextInstancedShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInterface.kt new file mode 100644 index 000000000..355a6985c --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInterface.kt @@ -0,0 +1,66 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.TextInterface + +actual interface KMTextInterface +{ + + actual fun setTextsShared(vertices: KMSharedBytes, indices: KMSharedBytes) + + actual fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + actual fun removeTexture() + + actual fun asGraphicsObject(): KMGraphicsObjectInterface +} + +private class KMTextInterfacePlatformWrapper(internal val nativeHandle: TextInterface) : KMTextInterface +{ + + override fun setTextsShared(vertices: KMSharedBytes, indices: KMSharedBytes) { + nativeHandle.setTextsShared(vertices.asPlatform(), indices.asPlatform()) + } + + override fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) { + nativeHandle.loadTexture(context.asPlatform(), textureHolder.asPlatform()) + } + + override fun removeTexture() { + nativeHandle.removeTexture() + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface).asKmp() + } +} + +private class KMTextInterfacePlatformProxy(private val delegate: KMTextInterface) : TextInterface() +{ + + override fun setTextsShared(vertices: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes, indices: io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes) { + delegate.setTextsShared((vertices as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp(), (indices as io.openmobilemaps.mapscore.shared.graphics.common.SharedBytes).asKmp()) + } + + override fun loadTexture(context: io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface, textureHolder: io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface) { + delegate.loadTexture((context as io.openmobilemaps.mapscore.shared.graphics.RenderingContextInterface).asKmp(), (textureHolder as io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface).asKmp()) + } + + override fun removeTexture() { + delegate.removeTexture() + } + + override fun asGraphicsObject(): io.openmobilemaps.mapscore.shared.graphics.objects.GraphicsObjectInterface { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } +} + +internal fun KMTextInterface.asPlatform(): TextInterface = when (this) { + is KMTextInterfacePlatformWrapper -> this.nativeHandle + else -> KMTextInterfacePlatformProxy(this) +} +public fun TextInterface.asKmp(): KMTextInterface = KMTextInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextJustify.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextJustify.kt new file mode 100644 index 000000000..99c284fa2 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextJustify.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTextJustify = io.openmobilemaps.mapscore.shared.map.layers.text.TextJustify + +internal fun KMTextJustify.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.text.TextJustify = this +public fun io.openmobilemaps.mapscore.shared.map.layers.text.TextJustify.asKmp(): KMTextJustify = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextLayerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextLayerInterface.kt new file mode 100644 index 000000000..ebf463915 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextLayerInterface.kt @@ -0,0 +1,38 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.text.TextLayerInterface + +actual class KMTextLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as TextLayerInterface + + actual fun setTexts(texts: ArrayList) { + native.setTexts(ArrayList(texts.map { it.asPlatform() })) + } + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as io.openmobilemaps.mapscore.shared.map.LayerInterface).asKmp() + } + + actual fun invalidate() { + native.invalidate() + } + + actual companion object + { + + actual fun create(fontLoader: KMFontLoaderInterface): KMTextLayerInterface { + val result = TextLayerInterface.create(fontLoader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.layers.text.TextLayerInterface).asKmp() + } + } +} + +internal fun KMTextLayerInterface.asPlatform(): TextLayerInterface = nativeHandle as TextLayerInterface +public fun TextLayerInterface.asKmp(): KMTextLayerInterface = KMTextLayerInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextShaderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextShaderInterface.kt new file mode 100644 index 000000000..92f258aa5 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextShaderInterface.kt @@ -0,0 +1,33 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.shader.TextShaderInterface + +actual class KMTextShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as TextShaderInterface + + actual fun setColor(color: KMColor) { + native.setColor(color.asPlatform()) + } + + actual fun setOpacity(opacity: Float) { + native.setOpacity(opacity) + } + + actual fun setHaloColor(color: KMColor, width: Float, blur: Float) { + native.setHaloColor(color.asPlatform(), width, blur) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.ShaderProgramInterface).asKmp() + } +} + +internal fun KMTextShaderInterface.asPlatform(): TextShaderInterface = nativeHandle as TextShaderInterface +public fun TextShaderInterface.asKmp(): KMTextShaderInterface = KMTextShaderInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextSymbolPlacement.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextSymbolPlacement.kt new file mode 100644 index 000000000..1f0c244e1 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextSymbolPlacement.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTextSymbolPlacement = io.openmobilemaps.mapscore.shared.map.layers.text.TextSymbolPlacement + +internal fun KMTextSymbolPlacement.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.text.TextSymbolPlacement = this +public fun io.openmobilemaps.mapscore.shared.map.layers.text.TextSymbolPlacement.asKmp(): KMTextSymbolPlacement = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureAtlas.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureAtlas.kt new file mode 100644 index 000000000..c011cfdf7 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureAtlas.kt @@ -0,0 +1,21 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from packer.djinni + +package io.openmobilemaps.mapscore.kmp + +actual class KMTextureAtlas actual public constructor( + uvMap: HashMap, + texture: KMTextureHolderInterface?, +) { + actual val uvMap: HashMap = uvMap + actual val texture: KMTextureHolderInterface? = texture +} + +internal fun KMTextureAtlas.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.TextureAtlas = io.openmobilemaps.mapscore.shared.graphics.TextureAtlas( + uvMap = HashMap(uvMap.map { it.key to it.value.asPlatform() }.toMap()), + texture = texture?.let { it.asPlatform() }, +) +public fun io.openmobilemaps.mapscore.shared.graphics.TextureAtlas.asKmp(): KMTextureAtlas = KMTextureAtlas( + uvMap = HashMap(this.uvMap.map { it.key to (it.value as io.openmobilemaps.mapscore.shared.graphics.common.RectI).asKmp() }.toMap()), + texture = this.texture?.let { (it as io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface).asKmp() }, +) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureFilterType.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureFilterType.kt new file mode 100644 index 000000000..8857a66b8 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureFilterType.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTextureFilterType = io.openmobilemaps.mapscore.shared.graphics.objects.TextureFilterType + +internal fun KMTextureFilterType.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.objects.TextureFilterType = this +public fun io.openmobilemaps.mapscore.shared.graphics.objects.TextureFilterType.asKmp(): KMTextureFilterType = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureHolderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureHolderInterface.kt new file mode 100644 index 000000000..a2d724c76 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureHolderInterface.kt @@ -0,0 +1,94 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface + +actual interface KMTextureHolderInterface +{ + + actual fun getImageWidth(): Int + + actual fun getImageHeight(): Int + + actual fun getTextureWidth(): Int + + actual fun getTextureHeight(): Int + + actual fun attachToGraphics(): Int + + actual fun clearFromGraphics() +} + +private class KMTextureHolderInterfacePlatformWrapper(internal val nativeHandle: TextureHolderInterface) : KMTextureHolderInterface +{ + + override fun getImageWidth(): Int { + val result = nativeHandle.getImageWidth() + return result + } + + override fun getImageHeight(): Int { + val result = nativeHandle.getImageHeight() + return result + } + + override fun getTextureWidth(): Int { + val result = nativeHandle.getTextureWidth() + return result + } + + override fun getTextureHeight(): Int { + val result = nativeHandle.getTextureHeight() + return result + } + + override fun attachToGraphics(): Int { + val result = nativeHandle.attachToGraphics() + return result + } + + override fun clearFromGraphics() { + nativeHandle.clearFromGraphics() + } +} + +private class KMTextureHolderInterfacePlatformProxy(private val delegate: KMTextureHolderInterface) : TextureHolderInterface() +{ + + override fun getImageWidth(): Int { + val result = delegate.getImageWidth() + return result + } + + override fun getImageHeight(): Int { + val result = delegate.getImageHeight() + return result + } + + override fun getTextureWidth(): Int { + val result = delegate.getTextureWidth() + return result + } + + override fun getTextureHeight(): Int { + val result = delegate.getTextureHeight() + return result + } + + override fun attachToGraphics(): Int { + val result = delegate.attachToGraphics() + return result + } + + override fun clearFromGraphics() { + delegate.clearFromGraphics() + } +} + +internal fun KMTextureHolderInterface.asPlatform(): TextureHolderInterface = when (this) { + is KMTextureHolderInterfacePlatformWrapper -> this.nativeHandle + else -> KMTextureHolderInterfacePlatformProxy(this) +} +public fun TextureHolderInterface.asKmp(): KMTextureHolderInterface = KMTextureHolderInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureLoaderResult.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureLoaderResult.kt new file mode 100644 index 000000000..41e049d06 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureLoaderResult.kt @@ -0,0 +1,29 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +actual class KMTextureLoaderResult actual public constructor( + data: KMTextureHolderInterface?, + etag: String?, + status: KMLoaderStatus, + errorCode: String?, +) { + actual val data: KMTextureHolderInterface? = data + actual val etag: String? = etag + actual val status: KMLoaderStatus = status + actual val errorCode: String? = errorCode +} + +internal fun KMTextureLoaderResult.asPlatform(): io.openmobilemaps.mapscore.shared.map.loader.TextureLoaderResult = io.openmobilemaps.mapscore.shared.map.loader.TextureLoaderResult( + data = data?.let { it.asPlatform() }, + etag = etag?.let { it }, + status = status.asPlatform(), + errorCode = errorCode?.let { it }, +) +public fun io.openmobilemaps.mapscore.shared.map.loader.TextureLoaderResult.asKmp(): KMTextureLoaderResult = KMTextureLoaderResult( + data = this.data?.let { (it as io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface).asKmp() }, + etag = this.etag?.let { it }, + status = (this.status as io.openmobilemaps.mapscore.shared.map.loader.LoaderStatus).asKmp(), + errorCode = this.errorCode?.let { it }, +) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMThreadPoolScheduler.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMThreadPoolScheduler.kt new file mode 100644 index 000000000..7e77269bb --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMThreadPoolScheduler.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.scheduling.ThreadPoolScheduler + +actual class KMThreadPoolScheduler actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as ThreadPoolScheduler + + actual companion object + { + + actual fun create(): KMSchedulerInterface { + val result = ThreadPoolScheduler.create() + return (result as io.openmobilemaps.mapscore.shared.map.scheduling.SchedulerInterface).asKmp() + } + } +} + +internal fun KMThreadPoolScheduler.asPlatform(): ThreadPoolScheduler = nativeHandle as ThreadPoolScheduler +public fun ThreadPoolScheduler.asKmp(): KMThreadPoolScheduler = KMThreadPoolScheduler(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapLayerConfig.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapLayerConfig.kt new file mode 100644 index 000000000..ee7d8703f --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapLayerConfig.kt @@ -0,0 +1,120 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapLayerConfig + +actual interface KMTiled2dMapLayerConfig +{ + + actual fun getCoordinateSystemIdentifier(): Int + + actual fun getTileUrl(x: Int, y: Int, t: Int, zoom: Int): String + + actual fun getZoomLevelInfos(): ArrayList + + actual fun getVirtualZoomLevelInfos(): ArrayList + + actual fun getZoomInfo(): KMTiled2dMapZoomInfo + + actual fun getLayerName(): String + + actual fun getVectorSettings(): KMTiled2dMapVectorSettings? + + actual fun getBounds(): KMRectCoord? +} + +private class KMTiled2dMapLayerConfigPlatformWrapper(internal val nativeHandle: Tiled2dMapLayerConfig) : KMTiled2dMapLayerConfig +{ + + override fun getCoordinateSystemIdentifier(): Int { + val result = nativeHandle.getCoordinateSystemIdentifier() + return result + } + + override fun getTileUrl(x: Int, y: Int, t: Int, zoom: Int): String { + val result = nativeHandle.getTileUrl(x, y, t, zoom) + return result + } + + override fun getZoomLevelInfos(): ArrayList { + val result = nativeHandle.getZoomLevelInfos() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapZoomLevelInfo).asKmp() }) + } + + override fun getVirtualZoomLevelInfos(): ArrayList { + val result = nativeHandle.getVirtualZoomLevelInfos() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapZoomLevelInfo).asKmp() }) + } + + override fun getZoomInfo(): KMTiled2dMapZoomInfo { + val result = nativeHandle.getZoomInfo() + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapZoomInfo).asKmp() + } + + override fun getLayerName(): String { + val result = nativeHandle.getLayerName() + return result + } + + override fun getVectorSettings(): KMTiled2dMapVectorSettings? { + val result = nativeHandle.getVectorSettings() + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapVectorSettings).asKmp() } + } + + override fun getBounds(): KMRectCoord? { + val result = nativeHandle.getBounds() + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord).asKmp() } + } +} + +private class KMTiled2dMapLayerConfigPlatformProxy(private val delegate: KMTiled2dMapLayerConfig) : Tiled2dMapLayerConfig() +{ + + override fun getCoordinateSystemIdentifier(): Int { + val result = delegate.getCoordinateSystemIdentifier() + return result + } + + override fun getTileUrl(x: Int, y: Int, t: Int, zoom: Int): String { + val result = delegate.getTileUrl(x, y, t, zoom) + return result + } + + override fun getZoomLevelInfos(): ArrayList { + val result = delegate.getZoomLevelInfos() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun getVirtualZoomLevelInfos(): ArrayList { + val result = delegate.getVirtualZoomLevelInfos() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun getZoomInfo(): io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapZoomInfo { + val result = delegate.getZoomInfo() + return result.asPlatform() + } + + override fun getLayerName(): String { + val result = delegate.getLayerName() + return result + } + + override fun getVectorSettings(): io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapVectorSettings? { + val result = delegate.getVectorSettings() + return result?.let { it.asPlatform() } + } + + override fun getBounds(): io.openmobilemaps.mapscore.shared.map.coordinates.RectCoord? { + val result = delegate.getBounds() + return result?.let { it.asPlatform() } + } +} + +internal fun KMTiled2dMapLayerConfig.asPlatform(): Tiled2dMapLayerConfig = when (this) { + is KMTiled2dMapLayerConfigPlatformWrapper -> this.nativeHandle + else -> KMTiled2dMapLayerConfigPlatformProxy(this) +} +public fun Tiled2dMapLayerConfig.asKmp(): KMTiled2dMapLayerConfig = KMTiled2dMapLayerConfigPlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerCallbackInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerCallbackInterface.kt new file mode 100644 index 000000000..2219413e0 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerCallbackInterface.kt @@ -0,0 +1,48 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_raster_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.Tiled2dMapRasterLayerCallbackInterface + +actual interface KMTiled2dMapRasterLayerCallbackInterface +{ + + actual fun onClickConfirmed(coord: KMCoord): Boolean + + actual fun onLongPress(coord: KMCoord): Boolean +} + +private class KMTiled2dMapRasterLayerCallbackInterfacePlatformWrapper(internal val nativeHandle: Tiled2dMapRasterLayerCallbackInterface) : KMTiled2dMapRasterLayerCallbackInterface +{ + + override fun onClickConfirmed(coord: KMCoord): Boolean { + val result = nativeHandle.onClickConfirmed(coord.asPlatform()) + return result + } + + override fun onLongPress(coord: KMCoord): Boolean { + val result = nativeHandle.onLongPress(coord.asPlatform()) + return result + } +} + +private class KMTiled2dMapRasterLayerCallbackInterfacePlatformProxy(private val delegate: KMTiled2dMapRasterLayerCallbackInterface) : Tiled2dMapRasterLayerCallbackInterface() +{ + + override fun onClickConfirmed(coord: io.openmobilemaps.mapscore.shared.map.coordinates.Coord): Boolean { + val result = delegate.onClickConfirmed((coord as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp()) + return result + } + + override fun onLongPress(coord: io.openmobilemaps.mapscore.shared.map.coordinates.Coord): Boolean { + val result = delegate.onLongPress((coord as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp()) + return result + } +} + +internal fun KMTiled2dMapRasterLayerCallbackInterface.asPlatform(): Tiled2dMapRasterLayerCallbackInterface = when (this) { + is KMTiled2dMapRasterLayerCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMTiled2dMapRasterLayerCallbackInterfacePlatformProxy(this) +} +public fun Tiled2dMapRasterLayerCallbackInterface.asKmp(): KMTiled2dMapRasterLayerCallbackInterface = KMTiled2dMapRasterLayerCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerInterface.kt new file mode 100644 index 000000000..24a127443 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerInterface.kt @@ -0,0 +1,114 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_raster_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.Tiled2dMapRasterLayerInterface + +actual class KMTiled2dMapRasterLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as Tiled2dMapRasterLayerInterface + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as io.openmobilemaps.mapscore.shared.map.LayerInterface).asKmp() + } + + actual fun setCallbackHandler(handler: KMTiled2dMapRasterLayerCallbackInterface) { + native.setCallbackHandler(handler.asPlatform()) + } + + actual fun getCallbackHandler(): KMTiled2dMapRasterLayerCallbackInterface? { + val result = native.getCallbackHandler() + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.Tiled2dMapRasterLayerCallbackInterface).asKmp() } + } + + actual fun removeCallbackHandler() { + native.removeCallbackHandler() + } + + actual fun setAlpha(alpha: Float) { + native.setAlpha(alpha) + } + + actual fun getAlpha(): Float { + val result = native.getAlpha() + return result + } + + actual fun setStyle(style: KMRasterShaderStyle) { + native.setStyle(style.asPlatform()) + } + + actual fun getStyle(): KMRasterShaderStyle { + val result = native.getStyle() + return (result as io.openmobilemaps.mapscore.shared.graphics.shader.RasterShaderStyle).asKmp() + } + + actual fun setMinMagFilter(filterType: KMTextureFilterType) { + native.setMinMagFilter(filterType.asPlatform()) + } + + actual fun setMinZoomLevelIdentifier(value: Int?) { + native.setMinZoomLevelIdentifier(value?.let { it }) + } + + actual fun getMinZoomLevelIdentifier(): Int? { + val result = native.getMinZoomLevelIdentifier() + return result?.let { it } + } + + actual fun setMaxZoomLevelIdentifier(value: Int?) { + native.setMaxZoomLevelIdentifier(value?.let { it }) + } + + actual fun getMaxZoomLevelIdentifier(): Int? { + val result = native.getMaxZoomLevelIdentifier() + return result?.let { it } + } + + actual fun setT(t: Int) { + native.setT(t) + } + + actual fun setReadyStateListener(listener: KMTiled2dMapReadyStateListener?) { + native.setReadyStateListener(listener?.let { it.asPlatform() }) + } + + actual fun getConfig(): KMTiled2dMapLayerConfig { + val result = native.getConfig() + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapLayerConfig).asKmp() + } + + actual fun set3dSubdivisionFactor(factor: Int) { + native.set3dSubdivisionFactor(factor) + } + + actual fun setBlendMode(blendMode: KMBlendMode) { + native.setBlendMode(blendMode.asPlatform()) + } + + actual companion object + { + + actual fun createWithMask(layerConfig: KMTiled2dMapLayerConfig, loaders: ArrayList, mask: KMMaskingObjectInterface): KMTiled2dMapRasterLayerInterface { + val result = Tiled2dMapRasterLayerInterface.createWithMask(layerConfig.asPlatform(), ArrayList(loaders.map { it.asPlatform() }), mask.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.Tiled2dMapRasterLayerInterface).asKmp() + } + + actual fun createWithShader(layerConfig: KMTiled2dMapLayerConfig, loaders: ArrayList, shader: KMShaderProgramInterface): KMTiled2dMapRasterLayerInterface { + val result = Tiled2dMapRasterLayerInterface.createWithShader(layerConfig.asPlatform(), ArrayList(loaders.map { it.asPlatform() }), shader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.Tiled2dMapRasterLayerInterface).asKmp() + } + + actual fun create(layerConfig: KMTiled2dMapLayerConfig, loaders: ArrayList): KMTiled2dMapRasterLayerInterface { + val result = Tiled2dMapRasterLayerInterface.create(layerConfig.asPlatform(), ArrayList(loaders.map { it.asPlatform() })) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.Tiled2dMapRasterLayerInterface).asKmp() + } + } +} + +internal fun KMTiled2dMapRasterLayerInterface.asPlatform(): Tiled2dMapRasterLayerInterface = nativeHandle as Tiled2dMapRasterLayerInterface +public fun Tiled2dMapRasterLayerInterface.asKmp(): KMTiled2dMapRasterLayerInterface = KMTiled2dMapRasterLayerInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapReadyStateListener.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapReadyStateListener.kt new file mode 100644 index 000000000..4b6c5d6c0 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapReadyStateListener.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapReadyStateListener + +actual interface KMTiled2dMapReadyStateListener +{ + + actual fun stateUpdate(state: KMLayerReadyState) +} + +private class KMTiled2dMapReadyStateListenerPlatformWrapper(internal val nativeHandle: Tiled2dMapReadyStateListener) : KMTiled2dMapReadyStateListener +{ + + override fun stateUpdate(state: KMLayerReadyState) { + nativeHandle.stateUpdate(state.asPlatform()) + } +} + +private class KMTiled2dMapReadyStateListenerPlatformProxy(private val delegate: KMTiled2dMapReadyStateListener) : Tiled2dMapReadyStateListener() +{ + + override fun stateUpdate(state: io.openmobilemaps.mapscore.shared.map.LayerReadyState) { + delegate.stateUpdate((state as io.openmobilemaps.mapscore.shared.map.LayerReadyState).asKmp()) + } +} + +internal fun KMTiled2dMapReadyStateListener.asPlatform(): Tiled2dMapReadyStateListener = when (this) { + is KMTiled2dMapReadyStateListenerPlatformWrapper -> this.nativeHandle + else -> KMTiled2dMapReadyStateListenerPlatformProxy(this) +} +public fun Tiled2dMapReadyStateListener.asKmp(): KMTiled2dMapReadyStateListener = KMTiled2dMapReadyStateListenerPlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapSourceInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapSourceInterface.kt new file mode 100644 index 000000000..4b26312a6 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapSourceInterface.kt @@ -0,0 +1,67 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapSourceInterface + +actual class KMTiled2dMapSourceInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as Tiled2dMapSourceInterface + + actual fun onVisibleBoundsChanged(visibleBounds: KMRectCoord, curT: Int, zoom: Double) { + native.onVisibleBoundsChanged(visibleBounds.asPlatform(), curT, zoom) + } + + actual fun onCameraChange(viewMatrix: ArrayList, projectionMatrix: ArrayList, origin: KMVec3D, verticalFov: Float, horizontalFov: Float, width: Float, height: Float, focusPointAltitude: Float, focusPointPosition: KMCoord, zoom: Float) { + native.onCameraChange(ArrayList(viewMatrix.map { it }), ArrayList(projectionMatrix.map { it }), origin.asPlatform(), verticalFov, horizontalFov, width, height, focusPointAltitude, focusPointPosition.asPlatform(), zoom) + } + + actual fun setMinZoomLevelIdentifier(value: Int?) { + native.setMinZoomLevelIdentifier(value?.let { it }) + } + + actual fun getMinZoomLevelIdentifier(): Int? { + val result = native.getMinZoomLevelIdentifier() + return result?.let { it } + } + + actual fun setMaxZoomLevelIdentifier(value: Int?) { + native.setMaxZoomLevelIdentifier(value?.let { it }) + } + + actual fun getMaxZoomLevelIdentifier(): Int? { + val result = native.getMaxZoomLevelIdentifier() + return result?.let { it } + } + + actual fun pause() { + native.pause() + } + + actual fun resume() { + native.resume() + } + + actual fun isReadyToRenderOffscreen(): KMLayerReadyState { + val result = native.isReadyToRenderOffscreen() + return (result as io.openmobilemaps.mapscore.shared.map.LayerReadyState).asKmp() + } + + actual fun setErrorManager(errorManager: KMErrorManager) { + native.setErrorManager(errorManager.asPlatform()) + } + + actual fun forceReload() { + native.forceReload() + } + + actual fun notifyTilesUpdates() { + native.notifyTilesUpdates() + } +} + +internal fun KMTiled2dMapSourceInterface.asPlatform(): Tiled2dMapSourceInterface = nativeHandle as Tiled2dMapSourceInterface +public fun Tiled2dMapSourceInterface.asKmp(): KMTiled2dMapSourceInterface = KMTiled2dMapSourceInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorAssetInfo.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorAssetInfo.kt new file mode 100644 index 000000000..71af3c2a6 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorAssetInfo.kt @@ -0,0 +1,21 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +actual class KMTiled2dMapVectorAssetInfo actual public constructor( + featureIdentifiersUv: HashMap, + texture: KMTextureHolderInterface?, +) { + actual val featureIdentifiersUv: HashMap = featureIdentifiersUv + actual val texture: KMTextureHolderInterface? = texture +} + +internal fun KMTiled2dMapVectorAssetInfo.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.Tiled2dMapVectorAssetInfo = io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.Tiled2dMapVectorAssetInfo( + featureIdentifiersUv = HashMap(featureIdentifiersUv.map { it.key to it.value.asPlatform() }.toMap()), + texture = texture?.let { it.asPlatform() }, +) +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.Tiled2dMapVectorAssetInfo.asKmp(): KMTiled2dMapVectorAssetInfo = KMTiled2dMapVectorAssetInfo( + featureIdentifiersUv = HashMap(this.featureIdentifiersUv.map { it.key to (it.value as io.openmobilemaps.mapscore.shared.graphics.common.RectI).asKmp() }.toMap()), + texture = this.texture?.let { (it as io.openmobilemaps.mapscore.shared.graphics.objects.TextureHolderInterface).asKmp() }, +) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerInterface.kt new file mode 100644 index 000000000..1151bd882 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerInterface.kt @@ -0,0 +1,91 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.Tiled2dMapVectorLayerInterface + +actual class KMTiled2dMapVectorLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as Tiled2dMapVectorLayerInterface + + actual fun setSelectionDelegate(selectionDelegate: KMTiled2dMapVectorLayerSelectionCallbackInterface?) { + native.setSelectionDelegate(selectionDelegate?.let { it.asPlatform() }) + } + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as io.openmobilemaps.mapscore.shared.map.LayerInterface).asKmp() + } + + actual fun setMinZoomLevelIdentifier(value: Int?) { + native.setMinZoomLevelIdentifier(value?.let { it }) + } + + actual fun getMinZoomLevelIdentifier(): Int? { + val result = native.getMinZoomLevelIdentifier() + return result?.let { it } + } + + actual fun setMaxZoomLevelIdentifier(value: Int?) { + native.setMaxZoomLevelIdentifier(value?.let { it }) + } + + actual fun getMaxZoomLevelIdentifier(): Int? { + val result = native.getMaxZoomLevelIdentifier() + return result?.let { it } + } + + actual fun getStyleMetadataJson(): String? { + val result = native.getStyleMetadataJson() + return result?.let { it } + } + + actual fun setFeatureState(identifier: String, properties: HashMap) { + native.setFeatureState(identifier, HashMap(properties.map { it.key to it.value.asPlatform() }.toMap())) + } + + actual fun setGlobalState(properties: HashMap) { + native.setGlobalState(HashMap(properties.map { it.key to it.value.asPlatform() }.toMap())) + } + + actual fun getVisiblePointFeatureContexts(paddingPc: Float, sourceLayer: String?): ArrayList { + val result = native.getVisiblePointFeatureContexts(paddingPc, sourceLayer?.let { it }) + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureCoordInfo).asKmp() }) + } + + actual fun setReadyStateListener(listener: KMTiled2dMapReadyStateListener?) { + native.setReadyStateListener(listener?.let { it.asPlatform() }) + } + + actual fun reloadDataSource(sourceName: String) { + native.reloadDataSource(sourceName) + } + + actual fun reloadLocalDataSource(sourceName: String, geoJson: String) { + native.reloadLocalDataSource(sourceName, geoJson) + } + + actual fun performClick(coord: KMCoord) { + native.performClick(coord.asPlatform()) + } + + actual companion object + { + + actual fun createFromStyleJson(layerName: String, styleJsonUrl: String, loaders: ArrayList, fontLoader: KMFontLoaderInterface): KMTiled2dMapVectorLayerInterface { + val result = Tiled2dMapVectorLayerInterface.createFromStyleJson(layerName, styleJsonUrl, ArrayList(loaders.map { it.asPlatform() }), fontLoader.asPlatform()) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.Tiled2dMapVectorLayerInterface).asKmp() + } + + actual fun createExplicitly(layerName: String, styleJson: String?, localStyleJson: Boolean?, loaders: ArrayList, fontLoader: KMFontLoaderInterface, localDataProvider: KMTiled2dMapVectorLayerLocalDataProviderInterface?, customZoomInfo: KMTiled2dMapZoomInfo?, symbolDelegate: KMTiled2dMapVectorLayerSymbolDelegateInterface?, sourceUrlParams: HashMap?): KMTiled2dMapVectorLayerInterface { + val result = Tiled2dMapVectorLayerInterface.createExplicitly(layerName, styleJson?.let { it }, localStyleJson?.let { it }, ArrayList(loaders.map { it.asPlatform() }), fontLoader.asPlatform(), localDataProvider?.let { it.asPlatform() }, customZoomInfo?.let { it.asPlatform() }, symbolDelegate?.let { it.asPlatform() }, sourceUrlParams?.let { HashMap(it.map { it.key to it.value }.toMap()) }) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.Tiled2dMapVectorLayerInterface).asKmp() + } + } +} + +internal fun KMTiled2dMapVectorLayerInterface.asPlatform(): Tiled2dMapVectorLayerInterface = nativeHandle as Tiled2dMapVectorLayerInterface +public fun Tiled2dMapVectorLayerInterface.asKmp(): KMTiled2dMapVectorLayerInterface = KMTiled2dMapVectorLayerInterface(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerLocalDataProviderInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerLocalDataProviderInterface.kt new file mode 100644 index 000000000..7299320c3 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerLocalDataProviderInterface.kt @@ -0,0 +1,72 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.Tiled2dMapVectorLayerLocalDataProviderInterface + +actual interface KMTiled2dMapVectorLayerLocalDataProviderInterface +{ + + actual fun getStyleJson(): String? + + actual fun loadSpriteAsync(spriteId: String, url: String, scale: Int): KMFuture + + actual fun loadSpriteJsonAsync(spriteId: String, url: String, scale: Int): KMFuture + + actual fun loadGeojson(sourceName: String, url: String): KMFuture +} + +private class KMTiled2dMapVectorLayerLocalDataProviderInterfacePlatformWrapper(internal val nativeHandle: Tiled2dMapVectorLayerLocalDataProviderInterface) : KMTiled2dMapVectorLayerLocalDataProviderInterface +{ + + override fun getStyleJson(): String? { + val result = nativeHandle.getStyleJson() + return result?.let { it } + } + + override fun loadSpriteAsync(spriteId: String, url: String, scale: Int): KMFuture { + val result = nativeHandle.loadSpriteAsync(spriteId, url, scale) + return (result as com.snapchat.djinni.Future).asKmp() + } + + override fun loadSpriteJsonAsync(spriteId: String, url: String, scale: Int): KMFuture { + val result = nativeHandle.loadSpriteJsonAsync(spriteId, url, scale) + return (result as com.snapchat.djinni.Future).asKmp() + } + + override fun loadGeojson(sourceName: String, url: String): KMFuture { + val result = nativeHandle.loadGeojson(sourceName, url) + return (result as com.snapchat.djinni.Future).asKmp() + } +} + +private class KMTiled2dMapVectorLayerLocalDataProviderInterfacePlatformProxy(private val delegate: KMTiled2dMapVectorLayerLocalDataProviderInterface) : Tiled2dMapVectorLayerLocalDataProviderInterface() +{ + + override fun getStyleJson(): String? { + val result = delegate.getStyleJson() + return result?.let { it } + } + + override fun loadSpriteAsync(spriteId: String, url: String, scale: Int): com.snapchat.djinni.Future { + val result = delegate.loadSpriteAsync(spriteId, url, scale) + return result.asPlatform() + } + + override fun loadSpriteJsonAsync(spriteId: String, url: String, scale: Int): com.snapchat.djinni.Future { + val result = delegate.loadSpriteJsonAsync(spriteId, url, scale) + return result.asPlatform() + } + + override fun loadGeojson(sourceName: String, url: String): com.snapchat.djinni.Future { + val result = delegate.loadGeojson(sourceName, url) + return result.asPlatform() + } +} + +internal fun KMTiled2dMapVectorLayerLocalDataProviderInterface.asPlatform(): Tiled2dMapVectorLayerLocalDataProviderInterface = when (this) { + is KMTiled2dMapVectorLayerLocalDataProviderInterfacePlatformWrapper -> this.nativeHandle + else -> KMTiled2dMapVectorLayerLocalDataProviderInterfacePlatformProxy(this) +} +public fun Tiled2dMapVectorLayerLocalDataProviderInterface.asKmp(): KMTiled2dMapVectorLayerLocalDataProviderInterface = KMTiled2dMapVectorLayerLocalDataProviderInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSelectionCallbackInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSelectionCallbackInterface.kt new file mode 100644 index 000000000..4c262a2d5 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSelectionCallbackInterface.kt @@ -0,0 +1,60 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.Tiled2dMapVectorLayerSelectionCallbackInterface + +actual interface KMTiled2dMapVectorLayerSelectionCallbackInterface +{ + + actual fun didSelectFeature(featureInfo: KMVectorLayerFeatureInfo, layerIdentifier: String, coord: KMCoord): Boolean + + actual fun didMultiSelectLayerFeatures(featureInfos: ArrayList, layerIdentifier: String, coord: KMCoord): Boolean + + actual fun didClickBackgroundConfirmed(coord: KMCoord): Boolean +} + +private class KMTiled2dMapVectorLayerSelectionCallbackInterfacePlatformWrapper(internal val nativeHandle: Tiled2dMapVectorLayerSelectionCallbackInterface) : KMTiled2dMapVectorLayerSelectionCallbackInterface +{ + + override fun didSelectFeature(featureInfo: KMVectorLayerFeatureInfo, layerIdentifier: String, coord: KMCoord): Boolean { + val result = nativeHandle.didSelectFeature(featureInfo.asPlatform(), layerIdentifier, coord.asPlatform()) + return result + } + + override fun didMultiSelectLayerFeatures(featureInfos: ArrayList, layerIdentifier: String, coord: KMCoord): Boolean { + val result = nativeHandle.didMultiSelectLayerFeatures(ArrayList(featureInfos.map { it.asPlatform() }), layerIdentifier, coord.asPlatform()) + return result + } + + override fun didClickBackgroundConfirmed(coord: KMCoord): Boolean { + val result = nativeHandle.didClickBackgroundConfirmed(coord.asPlatform()) + return result + } +} + +private class KMTiled2dMapVectorLayerSelectionCallbackInterfacePlatformProxy(private val delegate: KMTiled2dMapVectorLayerSelectionCallbackInterface) : Tiled2dMapVectorLayerSelectionCallbackInterface() +{ + + override fun didSelectFeature(featureInfo: io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfo, layerIdentifier: String, coord: io.openmobilemaps.mapscore.shared.map.coordinates.Coord): Boolean { + val result = delegate.didSelectFeature((featureInfo as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfo).asKmp(), layerIdentifier, (coord as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp()) + return result + } + + override fun didMultiSelectLayerFeatures(featureInfos: ArrayList, layerIdentifier: String, coord: io.openmobilemaps.mapscore.shared.map.coordinates.Coord): Boolean { + val result = delegate.didMultiSelectLayerFeatures(ArrayList(featureInfos.map { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfo).asKmp() }), layerIdentifier, (coord as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp()) + return result + } + + override fun didClickBackgroundConfirmed(coord: io.openmobilemaps.mapscore.shared.map.coordinates.Coord): Boolean { + val result = delegate.didClickBackgroundConfirmed((coord as io.openmobilemaps.mapscore.shared.map.coordinates.Coord).asKmp()) + return result + } +} + +internal fun KMTiled2dMapVectorLayerSelectionCallbackInterface.asPlatform(): Tiled2dMapVectorLayerSelectionCallbackInterface = when (this) { + is KMTiled2dMapVectorLayerSelectionCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMTiled2dMapVectorLayerSelectionCallbackInterfacePlatformProxy(this) +} +public fun Tiled2dMapVectorLayerSelectionCallbackInterface.asKmp(): KMTiled2dMapVectorLayerSelectionCallbackInterface = KMTiled2dMapVectorLayerSelectionCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSymbolDelegateInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSymbolDelegateInterface.kt new file mode 100644 index 000000000..db6b4c262 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSymbolDelegateInterface.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.Tiled2dMapVectorLayerSymbolDelegateInterface + +actual interface KMTiled2dMapVectorLayerSymbolDelegateInterface +{ + + actual fun getCustomAssetsFor(featureInfos: ArrayList, layerIdentifier: String): ArrayList +} + +private class KMTiled2dMapVectorLayerSymbolDelegateInterfacePlatformWrapper(internal val nativeHandle: Tiled2dMapVectorLayerSymbolDelegateInterface) : KMTiled2dMapVectorLayerSymbolDelegateInterface +{ + + override fun getCustomAssetsFor(featureInfos: ArrayList, layerIdentifier: String): ArrayList { + val result = nativeHandle.getCustomAssetsFor(ArrayList(featureInfos.map { it.asPlatform() }), layerIdentifier) + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.Tiled2dMapVectorAssetInfo).asKmp() }) + } +} + +private class KMTiled2dMapVectorLayerSymbolDelegateInterfacePlatformProxy(private val delegate: KMTiled2dMapVectorLayerSymbolDelegateInterface) : Tiled2dMapVectorLayerSymbolDelegateInterface() +{ + + override fun getCustomAssetsFor(featureInfos: ArrayList, layerIdentifier: String): ArrayList { + val result = delegate.getCustomAssetsFor(ArrayList(featureInfos.map { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfo).asKmp() }), layerIdentifier) + return ArrayList(result.map { it.asPlatform() }) + } +} + +internal fun KMTiled2dMapVectorLayerSymbolDelegateInterface.asPlatform(): Tiled2dMapVectorLayerSymbolDelegateInterface = when (this) { + is KMTiled2dMapVectorLayerSymbolDelegateInterfacePlatformWrapper -> this.nativeHandle + else -> KMTiled2dMapVectorLayerSymbolDelegateInterfacePlatformProxy(this) +} +public fun Tiled2dMapVectorLayerSymbolDelegateInterface.asKmp(): KMTiled2dMapVectorLayerSymbolDelegateInterface = KMTiled2dMapVectorLayerSymbolDelegateInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorSettings.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorSettings.kt new file mode 100644 index 000000000..f8dbc4989 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorSettings.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTiled2dMapVectorSettings = io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapVectorSettings + +internal fun KMTiled2dMapVectorSettings.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapVectorSettings = this +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapVectorSettings.asKmp(): KMTiled2dMapVectorSettings = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorTileOrigin.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorTileOrigin.kt new file mode 100644 index 000000000..bf2a319af --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorTileOrigin.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTiled2dMapVectorTileOrigin = io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapVectorTileOrigin + +internal fun KMTiled2dMapVectorTileOrigin.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapVectorTileOrigin = this +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapVectorTileOrigin.asKmp(): KMTiled2dMapVectorTileOrigin = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomInfo.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomInfo.kt new file mode 100644 index 000000000..a038b9383 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomInfo.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTiled2dMapZoomInfo = io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapZoomInfo + +internal fun KMTiled2dMapZoomInfo.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapZoomInfo = this +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapZoomInfo.asKmp(): KMTiled2dMapZoomInfo = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomLevelInfo.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomLevelInfo.kt new file mode 100644 index 000000000..686528c6f --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomLevelInfo.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTiled2dMapZoomLevelInfo = io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapZoomLevelInfo + +internal fun KMTiled2dMapZoomLevelInfo.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapZoomLevelInfo = this +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapZoomLevelInfo.asKmp(): KMTiled2dMapZoomLevelInfo = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiledLayerError.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiledLayerError.kt new file mode 100644 index 000000000..0c387b1ce --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiledLayerError.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTiledLayerError = io.openmobilemaps.mapscore.shared.map.TiledLayerError + +internal fun KMTiledLayerError.asPlatform(): io.openmobilemaps.mapscore.shared.map.TiledLayerError = this +public fun io.openmobilemaps.mapscore.shared.map.TiledLayerError.asKmp(): KMTiledLayerError = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchAction.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchAction.kt new file mode 100644 index 000000000..55e7491e7 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchAction.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTouchAction = io.openmobilemaps.mapscore.shared.map.controls.TouchAction + +internal fun KMTouchAction.asPlatform(): io.openmobilemaps.mapscore.shared.map.controls.TouchAction = this +public fun io.openmobilemaps.mapscore.shared.map.controls.TouchAction.asKmp(): KMTouchAction = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchEvent.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchEvent.kt new file mode 100644 index 000000000..ca5f4c5aa --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchEvent.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMTouchEvent = io.openmobilemaps.mapscore.shared.map.controls.TouchEvent + +internal fun KMTouchEvent.asPlatform(): io.openmobilemaps.mapscore.shared.map.controls.TouchEvent = this +public fun io.openmobilemaps.mapscore.shared.map.controls.TouchEvent.asKmp(): KMTouchEvent = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchHandlerInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchHandlerInterface.kt new file mode 100644 index 000000000..7360a3133 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchHandlerInterface.kt @@ -0,0 +1,64 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.controls.TouchHandlerInterface + +actual interface KMTouchHandlerInterface +{ + + actual fun onTouchEvent(touchEvent: KMTouchEvent) + + actual fun insertListener(listener: KMTouchInterface, index: Int) + + actual fun addListener(listener: KMTouchInterface) + + actual fun removeListener(listener: KMTouchInterface) +} + +private class KMTouchHandlerInterfacePlatformWrapper(internal val nativeHandle: TouchHandlerInterface) : KMTouchHandlerInterface +{ + + override fun onTouchEvent(touchEvent: KMTouchEvent) { + nativeHandle.onTouchEvent(touchEvent.asPlatform()) + } + + override fun insertListener(listener: KMTouchInterface, index: Int) { + nativeHandle.insertListener(listener.asPlatform(), index) + } + + override fun addListener(listener: KMTouchInterface) { + nativeHandle.addListener(listener.asPlatform()) + } + + override fun removeListener(listener: KMTouchInterface) { + nativeHandle.removeListener(listener.asPlatform()) + } +} + +private class KMTouchHandlerInterfacePlatformProxy(private val delegate: KMTouchHandlerInterface) : TouchHandlerInterface() +{ + + override fun onTouchEvent(touchEvent: io.openmobilemaps.mapscore.shared.map.controls.TouchEvent) { + delegate.onTouchEvent((touchEvent as io.openmobilemaps.mapscore.shared.map.controls.TouchEvent).asKmp()) + } + + override fun insertListener(listener: io.openmobilemaps.mapscore.shared.map.controls.TouchInterface, index: Int) { + delegate.insertListener((listener as io.openmobilemaps.mapscore.shared.map.controls.TouchInterface).asKmp(), index) + } + + override fun addListener(listener: io.openmobilemaps.mapscore.shared.map.controls.TouchInterface) { + delegate.addListener((listener as io.openmobilemaps.mapscore.shared.map.controls.TouchInterface).asKmp()) + } + + override fun removeListener(listener: io.openmobilemaps.mapscore.shared.map.controls.TouchInterface) { + delegate.removeListener((listener as io.openmobilemaps.mapscore.shared.map.controls.TouchInterface).asKmp()) + } +} + +internal fun KMTouchHandlerInterface.asPlatform(): TouchHandlerInterface = when (this) { + is KMTouchHandlerInterfacePlatformWrapper -> this.nativeHandle + else -> KMTouchHandlerInterfacePlatformProxy(this) +} +public fun TouchHandlerInterface.asKmp(): KMTouchHandlerInterface = KMTouchHandlerInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchInterface.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchInterface.kt new file mode 100644 index 000000000..1f965dc7b --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchInterface.kt @@ -0,0 +1,178 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.controls.TouchInterface + +actual interface KMTouchInterface +{ + + actual fun onTouchDown(posScreen: KMVec2F): Boolean + + actual fun onClickUnconfirmed(posScreen: KMVec2F): Boolean + + actual fun onClickConfirmed(posScreen: KMVec2F): Boolean + + actual fun onDoubleClick(posScreen: KMVec2F): Boolean + + actual fun onLongPress(posScreen: KMVec2F): Boolean + + actual fun onMove(deltaScreen: KMVec2F, confirmed: Boolean, doubleClick: Boolean): Boolean + + actual fun onMoveComplete(): Boolean + + actual fun onOneFingerDoubleClickMoveComplete(): Boolean + + actual fun onTwoFingerClick(posScreen1: KMVec2F, posScreen2: KMVec2F): Boolean + + actual fun onTwoFingerMove(posScreenOld: ArrayList, posScreenNew: ArrayList): Boolean + + actual fun onTwoFingerMoveComplete(): Boolean + + actual fun onScroll(posScreen: KMVec2F, scrollDelta: Float): Boolean + + actual fun clearTouch() +} + +private class KMTouchInterfacePlatformWrapper(internal val nativeHandle: TouchInterface) : KMTouchInterface +{ + + override fun onTouchDown(posScreen: KMVec2F): Boolean { + val result = nativeHandle.onTouchDown(posScreen.asPlatform()) + return result + } + + override fun onClickUnconfirmed(posScreen: KMVec2F): Boolean { + val result = nativeHandle.onClickUnconfirmed(posScreen.asPlatform()) + return result + } + + override fun onClickConfirmed(posScreen: KMVec2F): Boolean { + val result = nativeHandle.onClickConfirmed(posScreen.asPlatform()) + return result + } + + override fun onDoubleClick(posScreen: KMVec2F): Boolean { + val result = nativeHandle.onDoubleClick(posScreen.asPlatform()) + return result + } + + override fun onLongPress(posScreen: KMVec2F): Boolean { + val result = nativeHandle.onLongPress(posScreen.asPlatform()) + return result + } + + override fun onMove(deltaScreen: KMVec2F, confirmed: Boolean, doubleClick: Boolean): Boolean { + val result = nativeHandle.onMove(deltaScreen.asPlatform(), confirmed, doubleClick) + return result + } + + override fun onMoveComplete(): Boolean { + val result = nativeHandle.onMoveComplete() + return result + } + + override fun onOneFingerDoubleClickMoveComplete(): Boolean { + val result = nativeHandle.onOneFingerDoubleClickMoveComplete() + return result + } + + override fun onTwoFingerClick(posScreen1: KMVec2F, posScreen2: KMVec2F): Boolean { + val result = nativeHandle.onTwoFingerClick(posScreen1.asPlatform(), posScreen2.asPlatform()) + return result + } + + override fun onTwoFingerMove(posScreenOld: ArrayList, posScreenNew: ArrayList): Boolean { + val result = nativeHandle.onTwoFingerMove(ArrayList(posScreenOld.map { it.asPlatform() }), ArrayList(posScreenNew.map { it.asPlatform() })) + return result + } + + override fun onTwoFingerMoveComplete(): Boolean { + val result = nativeHandle.onTwoFingerMoveComplete() + return result + } + + override fun onScroll(posScreen: KMVec2F, scrollDelta: Float): Boolean { + val result = nativeHandle.onScroll(posScreen.asPlatform(), scrollDelta) + return result + } + + override fun clearTouch() { + nativeHandle.clearTouch() + } +} + +private class KMTouchInterfacePlatformProxy(private val delegate: KMTouchInterface) : TouchInterface() +{ + + override fun onTouchDown(posScreen: io.openmobilemaps.mapscore.shared.graphics.common.Vec2F): Boolean { + val result = delegate.onTouchDown((posScreen as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp()) + return result + } + + override fun onClickUnconfirmed(posScreen: io.openmobilemaps.mapscore.shared.graphics.common.Vec2F): Boolean { + val result = delegate.onClickUnconfirmed((posScreen as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp()) + return result + } + + override fun onClickConfirmed(posScreen: io.openmobilemaps.mapscore.shared.graphics.common.Vec2F): Boolean { + val result = delegate.onClickConfirmed((posScreen as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp()) + return result + } + + override fun onDoubleClick(posScreen: io.openmobilemaps.mapscore.shared.graphics.common.Vec2F): Boolean { + val result = delegate.onDoubleClick((posScreen as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp()) + return result + } + + override fun onLongPress(posScreen: io.openmobilemaps.mapscore.shared.graphics.common.Vec2F): Boolean { + val result = delegate.onLongPress((posScreen as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp()) + return result + } + + override fun onMove(deltaScreen: io.openmobilemaps.mapscore.shared.graphics.common.Vec2F, confirmed: Boolean, doubleClick: Boolean): Boolean { + val result = delegate.onMove((deltaScreen as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp(), confirmed, doubleClick) + return result + } + + override fun onMoveComplete(): Boolean { + val result = delegate.onMoveComplete() + return result + } + + override fun onOneFingerDoubleClickMoveComplete(): Boolean { + val result = delegate.onOneFingerDoubleClickMoveComplete() + return result + } + + override fun onTwoFingerClick(posScreen1: io.openmobilemaps.mapscore.shared.graphics.common.Vec2F, posScreen2: io.openmobilemaps.mapscore.shared.graphics.common.Vec2F): Boolean { + val result = delegate.onTwoFingerClick((posScreen1 as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp(), (posScreen2 as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp()) + return result + } + + override fun onTwoFingerMove(posScreenOld: ArrayList, posScreenNew: ArrayList): Boolean { + val result = delegate.onTwoFingerMove(ArrayList(posScreenOld.map { (it as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp() }), ArrayList(posScreenNew.map { (it as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp() })) + return result + } + + override fun onTwoFingerMoveComplete(): Boolean { + val result = delegate.onTwoFingerMoveComplete() + return result + } + + override fun onScroll(posScreen: io.openmobilemaps.mapscore.shared.graphics.common.Vec2F, scrollDelta: Float): Boolean { + val result = delegate.onScroll((posScreen as io.openmobilemaps.mapscore.shared.graphics.common.Vec2F).asKmp(), scrollDelta) + return result + } + + override fun clearTouch() { + delegate.clearTouch() + } +} + +internal fun KMTouchInterface.asPlatform(): TouchInterface = when (this) { + is KMTouchInterfacePlatformWrapper -> this.nativeHandle + else -> KMTouchInterfacePlatformProxy(this) +} +public fun TouchInterface.asKmp(): KMTouchInterface = KMTouchInterfacePlatformWrapper(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2D.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2D.kt new file mode 100644 index 000000000..39c1f0f3f --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2D.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMVec2D = io.openmobilemaps.mapscore.shared.graphics.common.Vec2D + +internal fun KMVec2D.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.Vec2D = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.Vec2D.asKmp(): KMVec2D = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2F.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2F.kt new file mode 100644 index 000000000..eca9798b2 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2F.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMVec2F = io.openmobilemaps.mapscore.shared.graphics.common.Vec2F + +internal fun KMVec2F.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.Vec2F = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.Vec2F.asKmp(): KMVec2F = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2I.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2I.kt new file mode 100644 index 000000000..e14bcea5b --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2I.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMVec2I = io.openmobilemaps.mapscore.shared.graphics.common.Vec2I + +internal fun KMVec2I.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.Vec2I = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.Vec2I.asKmp(): KMVec2I = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3D.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3D.kt new file mode 100644 index 000000000..4e28085eb --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3D.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMVec3D = io.openmobilemaps.mapscore.shared.graphics.common.Vec3D + +internal fun KMVec3D.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.Vec3D = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.Vec3D.asKmp(): KMVec3D = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3F.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3F.kt new file mode 100644 index 000000000..d73c9a6ff --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3F.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMVec3F = io.openmobilemaps.mapscore.shared.graphics.common.Vec3F + +internal fun KMVec3F.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.Vec3F = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.Vec3F.asKmp(): KMVec3F = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3I.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3I.kt new file mode 100644 index 000000000..48a421e5d --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3I.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMVec3I = io.openmobilemaps.mapscore.shared.graphics.common.Vec3I + +internal fun KMVec3I.asPlatform(): io.openmobilemaps.mapscore.shared.graphics.common.Vec3I = this +public fun io.openmobilemaps.mapscore.shared.graphics.common.Vec3I.asKmp(): KMVec3I = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureCoordInfo.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureCoordInfo.kt new file mode 100644 index 000000000..dbaf139b3 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureCoordInfo.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMVectorLayerFeatureCoordInfo = io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureCoordInfo + +internal fun KMVectorLayerFeatureCoordInfo.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureCoordInfo = this +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureCoordInfo.asKmp(): KMVectorLayerFeatureCoordInfo = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfo.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfo.kt new file mode 100644 index 000000000..35aeb85f2 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfo.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMVectorLayerFeatureInfo = io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfo + +internal fun KMVectorLayerFeatureInfo.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfo = this +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfo.asKmp(): KMVectorLayerFeatureInfo = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfoValue.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfoValue.kt new file mode 100644 index 000000000..0551cbbbc --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfoValue.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMVectorLayerFeatureInfoValue = io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfoValue + +internal fun KMVectorLayerFeatureInfoValue.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfoValue = this +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.vector.VectorLayerFeatureInfoValue.asKmp(): KMVectorLayerFeatureInfoValue = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsCapabilitiesResource.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsCapabilitiesResource.kt new file mode 100644 index 000000000..5c308e90d --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsCapabilitiesResource.kt @@ -0,0 +1,70 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsCapabilitiesResource + +actual class KMWmtsCapabilitiesResource actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as WmtsCapabilitiesResource + + actual fun createLayer(identifier: String, tileLoaders: ArrayList): KMTiled2dMapRasterLayerInterface? { + val result = native.createLayer(identifier, ArrayList(tileLoaders.map { it.asPlatform() })) + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.Tiled2dMapRasterLayerInterface).asKmp() } + } + + actual fun createLayerTimed(identifier: String, tileLoaders: ArrayList, numT: Int): KMTiled2dMapRasterLayerInterface? { + val result = native.createLayerTimed(identifier, ArrayList(tileLoaders.map { it.asPlatform() }), numT) + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.Tiled2dMapRasterLayerInterface).asKmp() } + } + + actual fun createLayerWithZoomInfo(identifier: String, tileLoaders: ArrayList, zoomInfo: KMTiled2dMapZoomInfo): KMTiled2dMapRasterLayerInterface? { + val result = native.createLayerWithZoomInfo(identifier, ArrayList(tileLoaders.map { it.asPlatform() }), zoomInfo.asPlatform()) + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.Tiled2dMapRasterLayerInterface).asKmp() } + } + + actual fun createLayerWithZoomInfoTimed(identifier: String, tileLoaders: ArrayList, zoomInfo: KMTiled2dMapZoomInfo, numT: Int): KMTiled2dMapRasterLayerInterface? { + val result = native.createLayerWithZoomInfoTimed(identifier, ArrayList(tileLoaders.map { it.asPlatform() }), zoomInfo.asPlatform(), numT) + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.Tiled2dMapRasterLayerInterface).asKmp() } + } + + actual fun createLayerConfig(identifier: String): KMTiled2dMapLayerConfig? { + val result = native.createLayerConfig(identifier) + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapLayerConfig).asKmp() } + } + + actual fun createLayerConfigTimed(identifier: String, numT: Int): KMTiled2dMapLayerConfig? { + val result = native.createLayerConfigTimed(identifier, numT) + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapLayerConfig).asKmp() } + } + + actual fun createLayerConfigWithZoomInfo(identifier: String, zoomInfo: KMTiled2dMapZoomInfo): KMTiled2dMapLayerConfig? { + val result = native.createLayerConfigWithZoomInfo(identifier, zoomInfo.asPlatform()) + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapLayerConfig).asKmp() } + } + + actual fun createLayerConfigWithZoomInfoTimed(identifier: String, zoomInfo: KMTiled2dMapZoomInfo, numT: Int): KMTiled2dMapLayerConfig? { + val result = native.createLayerConfigWithZoomInfoTimed(identifier, zoomInfo.asPlatform(), numT) + return result?.let { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapLayerConfig).asKmp() } + } + + actual fun getAllLayers(): ArrayList { + val result = native.getAllLayers() + return ArrayList(result.map { (it as io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsLayerDescription).asKmp() }) + } + + actual companion object + { + + actual fun create(xml: String): KMWmtsCapabilitiesResource { + val result = WmtsCapabilitiesResource.create(xml) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsCapabilitiesResource).asKmp() + } + } +} + +internal fun KMWmtsCapabilitiesResource.asPlatform(): WmtsCapabilitiesResource = nativeHandle as WmtsCapabilitiesResource +public fun WmtsCapabilitiesResource.asKmp(): KMWmtsCapabilitiesResource = KMWmtsCapabilitiesResource(this) diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDescription.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDescription.kt new file mode 100644 index 000000000..d45d969b5 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDescription.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMWmtsLayerDescription = io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsLayerDescription + +internal fun KMWmtsLayerDescription.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsLayerDescription = this +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsLayerDescription.asKmp(): KMWmtsLayerDescription = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDimension.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDimension.kt new file mode 100644 index 000000000..c9abd06ef --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDimension.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMWmtsLayerDimension = io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsLayerDimension + +internal fun KMWmtsLayerDimension.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsLayerDimension = this +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsLayerDimension.asKmp(): KMWmtsLayerDimension = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrix.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrix.kt new file mode 100644 index 000000000..b674f56da --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrix.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMWmtsTileMatrix = io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsTileMatrix + +internal fun KMWmtsTileMatrix.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsTileMatrix = this +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsTileMatrix.asKmp(): KMWmtsTileMatrix = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrixSet.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrixSet.kt new file mode 100644 index 000000000..73acce2da --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrixSet.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +package io.openmobilemaps.mapscore.kmp + +actual typealias KMWmtsTileMatrixSet = io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsTileMatrixSet + +internal fun KMWmtsTileMatrixSet.asPlatform(): io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsTileMatrixSet = this +public fun io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsTileMatrixSet.asKmp(): KMWmtsTileMatrixSet = this diff --git a/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTiled2dMapLayerConfigFactory.kt b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTiled2dMapLayerConfigFactory.kt new file mode 100644 index 000000000..f04f04ef1 --- /dev/null +++ b/bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTiled2dMapLayerConfigFactory.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +package io.openmobilemaps.mapscore.kmp + +import io.openmobilemaps.mapscore.shared.map.layers.tiled.raster.wmts.WmtsTiled2dMapLayerConfigFactory + +actual class KMWmtsTiled2dMapLayerConfigFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as WmtsTiled2dMapLayerConfigFactory + + actual companion object + { + + actual fun create(wmtsLayerConfiguration: KMWmtsLayerDescription, zoomLevelInfo: ArrayList, zoomInfo: KMTiled2dMapZoomInfo, coordinateSystemIdentifier: Int, matrixSetIdentifier: String): KMTiled2dMapLayerConfig { + val result = WmtsTiled2dMapLayerConfigFactory.create(wmtsLayerConfiguration.asPlatform(), ArrayList(zoomLevelInfo.map { it.asPlatform() }), zoomInfo.asPlatform(), coordinateSystemIdentifier, matrixSetIdentifier) + return (result as io.openmobilemaps.mapscore.shared.map.layers.tiled.Tiled2dMapLayerConfig).asKmp() + } + } +} + +internal fun KMWmtsTiled2dMapLayerConfigFactory.asPlatform(): WmtsTiled2dMapLayerConfigFactory = nativeHandle as WmtsTiled2dMapLayerConfigFactory +public fun WmtsTiled2dMapLayerConfigFactory.asKmp(): KMWmtsTiled2dMapLayerConfigFactory = KMWmtsTiled2dMapLayerConfigFactory(this) diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaInstancedShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaInstancedShaderInterface.kt new file mode 100644 index 000000000..7a39a67f7 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaInstancedShaderInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMAlphaInstancedShaderInterface constructor(nativeHandle: Any) { + + fun asShaderProgramInterface(): KMShaderProgramInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaShaderInterface.kt new file mode 100644 index 000000000..6cd527143 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaShaderInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMAlphaShaderInterface constructor(nativeHandle: Any) { + + fun updateAlpha(value: Float) + + fun asShaderProgramInterface(): KMShaderProgramInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAnchor.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAnchor.kt new file mode 100644 index 000000000..31dc1f008 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAnchor.kt @@ -0,0 +1,16 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMAnchor { + CENTER, + LEFT, + RIGHT, + TOP, + BOTTOM, + TOP_LEFT, + TOP_RIGHT, + BOTTOM_LEFT, + BOTTOM_RIGHT, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBlendMode.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBlendMode.kt new file mode 100644 index 000000000..689432084 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBlendMode.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMBlendMode { + NORMAL, + MULTIPLY, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBoundingBoxInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBoundingBoxInterface.kt new file mode 100644 index 000000000..f5ab806c6 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBoundingBoxInterface.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMBoundingBoxInterface constructor(nativeHandle: Any) { + + fun addPoint(p: KMCoord) + + fun asRectCoord(): KMRectCoord + + fun getCenter(): KMCoord + + fun getMin(): KMCoord + + fun getMax(): KMCoord + + fun getSystemIdentifier(): Int + + companion object + { + + fun create(systemIdentifier: Int): KMBoundingBoxInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfig.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfig.kt new file mode 100644 index 000000000..3b91e087e --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfig.kt @@ -0,0 +1,24 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMCamera3dConfig( + key: String, + allowUserInteraction: Boolean, + rotationSpeed: Float?, + animationDurationMs: Int, + minZoom: Float, + maxZoom: Float, + pitchInterpolationValues: KMCameraInterpolation, + verticalDisplacementInterpolationValues: KMCameraInterpolation, +) { + val key: String + val allowUserInteraction: Boolean + val rotationSpeed: Float? + val animationDurationMs: Int + val minZoom: Float + val maxZoom: Float + val pitchInterpolationValues: KMCameraInterpolation + val verticalDisplacementInterpolationValues: KMCameraInterpolation +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfigFactory.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfigFactory.kt new file mode 100644 index 000000000..5ec38e34b --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfigFactory.kt @@ -0,0 +1,15 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMCamera3dConfigFactory constructor(nativeHandle: Any) { + + companion object + { + + fun getBasicConfig(): KMCamera3dConfig + + fun getRestorConfig(): KMCamera3dConfig + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterface.kt new file mode 100644 index 000000000..e5cdbb0c3 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterface.kt @@ -0,0 +1,15 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMCameraInterface { + + fun getVpMatrix(): ArrayList + + fun getScalingFactor(): Double + + fun getOrigin(): KMVec3D + + fun viewportSizeChanged() +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolation.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolation.kt new file mode 100644 index 000000000..8cafebced --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolation.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMCameraInterpolation( + stops: ArrayList, +) { + val stops: ArrayList +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolationValue.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolationValue.kt new file mode 100644 index 000000000..4119e05bc --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolationValue.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMCameraInterpolationValue( + stop: Float, + value: Float, +) { + val stop: Float + val value: Float +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleD.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleD.kt new file mode 100644 index 000000000..281073774 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleD.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMCircleD( + x: Double, + y: Double, + radius: Double, +) { + val x: Double + val y: Double + val radius: Double +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleF.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleF.kt new file mode 100644 index 000000000..387b4bd1a --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleF.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMCircleF( + x: Float, + y: Float, + radius: Float, +) { + val x: Float + val y: Float + val radius: Float +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleI.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleI.kt new file mode 100644 index 000000000..549414bef --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleI.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMCircleI( + x: Int, + y: Int, + radius: Int, +) { + val x: Int + val y: Int + val radius: Int +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColor.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColor.kt new file mode 100644 index 000000000..ed0d82586 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColor.kt @@ -0,0 +1,16 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMColor( + r: Float, + g: Float, + b: Float, + a: Float, +) { + val r: Float + val g: Float + val b: Float + val a: Float +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorCircleShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorCircleShaderInterface.kt new file mode 100644 index 000000000..16d14834c --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorCircleShaderInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMColorCircleShaderInterface constructor(nativeHandle: Any) { + + fun setColor(red: Float, green: Float, blue: Float, alpha: Float) + + fun asShaderProgramInterface(): KMShaderProgramInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorShaderInterface.kt new file mode 100644 index 000000000..998e3e002 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorShaderInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMColorShaderInterface constructor(nativeHandle: Any) { + + fun setColor(red: Float, green: Float, blue: Float, alpha: Float) + + fun asShaderProgramInterface(): KMShaderProgramInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorStateList.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorStateList.kt new file mode 100644 index 000000000..734145c8d --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorStateList.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from styling.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMColorStateList( + normal: KMColor, + highlighted: KMColor, +) { + val normal: KMColor + val highlighted: KMColor +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputeObjectInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputeObjectInterface.kt new file mode 100644 index 000000000..533669006 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputeObjectInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMComputeObjectInterface { + + fun compute(context: KMRenderingContextInterface, vpMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputePassInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputePassInterface.kt new file mode 100644 index 000000000..549e4246a --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputePassInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMComputePassInterface { + + fun getComputeObjects(): ArrayList +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoord.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoord.kt new file mode 100644 index 000000000..752b3b1b1 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoord.kt @@ -0,0 +1,16 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMCoord( + systemIdentifier: Int, + x: Double, + y: Double, + z: Double, +) { + val systemIdentifier: Int + val x: Double + val y: Double + val z: Double +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConversionHelperInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConversionHelperInterface.kt new file mode 100644 index 000000000..60e855225 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConversionHelperInterface.kt @@ -0,0 +1,27 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMCoordinateConversionHelperInterface constructor(nativeHandle: Any) { + + fun registerConverter(converter: KMCoordinateConverterInterface) + + fun convert(to: Int, coordinate: KMCoord): KMCoord + + fun convertRect(to: Int, rect: KMRectCoord): KMRectCoord + + fun convertRectToRenderSystem(rect: KMRectCoord): KMRectCoord + + fun convertQuad(to: Int, quad: KMQuadCoord): KMQuadCoord + + fun convertQuadToRenderSystem(quad: KMQuadCoord): KMQuadCoord + + fun convertToRenderSystem(coordinate: KMCoord): KMCoord + + companion object + { + + fun independentInstance(): KMCoordinateConversionHelperInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConverterInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConverterInterface.kt new file mode 100644 index 000000000..2956b0b40 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConverterInterface.kt @@ -0,0 +1,13 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMCoordinateConverterInterface { + + fun convert(coordinate: KMCoord): KMCoord + + fun getFrom(): Int + + fun getTo(): Int +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemFactory.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemFactory.kt new file mode 100644 index 000000000..dcc97530e --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemFactory.kt @@ -0,0 +1,21 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMCoordinateSystemFactory constructor(nativeHandle: Any) { + + companion object + { + + fun getEpsg2056System(): KMMapCoordinateSystem + + fun getEpsg3857System(): KMMapCoordinateSystem + + fun getEpsg4326System(): KMMapCoordinateSystem + + fun getEpsg21781System(): KMMapCoordinateSystem + + fun getUnitSphereSystem(): KMMapCoordinateSystem + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemIdentifiers.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemIdentifiers.kt new file mode 100644 index 000000000..5485a8258 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemIdentifiers.kt @@ -0,0 +1,27 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMCoordinateSystemIdentifiers constructor(nativeHandle: Any) { + + companion object + { + + fun RENDERSYSTEM(): Int + + fun EPSG3857(): Int + + fun EPSG4326(): Int + + fun EPSG2056(): Int + + fun EPSG21781(): Int + + fun UnitSphere(): Int + + fun fromCrsIdentifier(identifier: String): Int + + fun unitToMeterFactor(coordinateSystemIdentifier: Int): Double + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCpuPerformanceLoggerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCpuPerformanceLoggerInterface.kt new file mode 100644 index 000000000..00437eaf5 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCpuPerformanceLoggerInterface.kt @@ -0,0 +1,17 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMCpuPerformanceLoggerInterface constructor(nativeHandle: Any) { + + fun asPerformanceLoggerInterface(): KMPerformanceLoggerInterface + + companion object + { + + fun create(): KMCpuPerformanceLoggerInterface + + fun createSpecifically(numBuckets: Int, bucketSizeMs: Long): KMCpuPerformanceLoggerInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataLoaderResult.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataLoaderResult.kt new file mode 100644 index 000000000..4320c4529 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataLoaderResult.kt @@ -0,0 +1,16 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMDataLoaderResult( + data: KMDataRef?, + etag: String?, + status: KMLoaderStatus, + errorCode: String?, +) { + val data: KMDataRef? + val etag: String? + val status: KMLoaderStatus + val errorCode: String? +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTiled2dMapLayerConfigs.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTiled2dMapLayerConfigs.kt new file mode 100644 index 000000000..2a69dc801 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTiled2dMapLayerConfigs.kt @@ -0,0 +1,19 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMDefaultTiled2dMapLayerConfigs constructor(nativeHandle: Any) { + + companion object + { + + fun webMercator(layerName: String, urlFormat: String): KMTiled2dMapLayerConfig + + fun webMercatorCustom(layerName: String, urlFormat: String, zoomInfo: KMTiled2dMapZoomInfo?, minZoomLevel: Int, maxZoomLevel: Int): KMTiled2dMapLayerConfig + + fun epsg4326(layerName: String, urlFormat: String): KMTiled2dMapLayerConfig + + fun epsg4326Custom(layerName: String, urlFormat: String, zoomInfo: KMTiled2dMapZoomInfo, minZoomLevel: Int, maxZoomLevel: Int): KMTiled2dMapLayerConfig + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTouchHandlerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTouchHandlerInterface.kt new file mode 100644 index 000000000..39f1ccbf9 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTouchHandlerInterface.kt @@ -0,0 +1,13 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMDefaultTouchHandlerInterface constructor(nativeHandle: Any) { + + companion object + { + + fun create(scheduler: KMSchedulerInterface, density: Float): KMTouchHandlerInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMElevationInterpolationShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMElevationInterpolationShaderInterface.kt new file mode 100644 index 000000000..3fa7c5d48 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMElevationInterpolationShaderInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMElevationInterpolationShaderInterface constructor(nativeHandle: Any) { + + fun asShaderProgramInterface(): KMShaderProgramInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManager.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManager.kt new file mode 100644 index 000000000..af1ba5302 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManager.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMErrorManager constructor(nativeHandle: Any) { + + fun addTiledLayerError(error: KMTiledLayerError) + + fun removeError(url: String) + + fun removeAllErrorsForLayer(layerName: String) + + fun clearAllErrors() + + fun addErrorListener(listener: KMErrorManagerListener) + + fun removeErrorListener(listener: KMErrorManagerListener) + + companion object + { + + fun create(): KMErrorManager + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManagerListener.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManagerListener.kt new file mode 100644 index 000000000..88cbf4efc --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManagerListener.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMErrorManagerListener { + + fun onTiledLayerErrorStateChanged(errors: ArrayList) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerDelegateInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerDelegateInterface.kt new file mode 100644 index 000000000..c480cd822 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerDelegateInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from exception_logger.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMExceptionLoggerDelegateInterface { + + fun logMessage(errorDomain: String, code: Int, customValues: HashMap, functionName: String, file: String, line: Int) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerInterface.kt new file mode 100644 index 000000000..961e12600 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerInterface.kt @@ -0,0 +1,13 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from exception_logger.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMExceptionLoggerInterface constructor(nativeHandle: Any) { + + companion object + { + + fun setLoggerDelegate(delegate: KMExceptionLoggerDelegateInterface) + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExecutionEnvironment.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExecutionEnvironment.kt new file mode 100644 index 000000000..1a88f2b38 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExecutionEnvironment.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMExecutionEnvironment { + IO, + COMPUTATION, + GRAPHICS, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFeatureInfoValueFactory.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFeatureInfoValueFactory.kt new file mode 100644 index 000000000..a2616cedf --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFeatureInfoValueFactory.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMFeatureInfoValueFactory constructor(nativeHandle: Any) { + + companion object + { + + fun createString(value: String): KMVectorLayerFeatureInfoValue + + fun createDouble(value: Double): KMVectorLayerFeatureInfoValue + + fun createInt(value: Long): KMVectorLayerFeatureInfoValue + + fun createBool(value: Boolean): KMVectorLayerFeatureInfoValue + + fun createColor(value: KMColor): KMVectorLayerFeatureInfoValue + + fun createListFloat(value: ArrayList): KMVectorLayerFeatureInfoValue + + fun createListString(value: ArrayList): KMVectorLayerFeatureInfoValue + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFont.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFont.kt new file mode 100644 index 000000000..4a7403008 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFont.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMFont( + name: String, +) { + val name: String +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontData.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontData.kt new file mode 100644 index 000000000..a4e18af55 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontData.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMFontData( + info: KMFontWrapper, + glyphs: ArrayList, +) { + val info: KMFontWrapper + val glyphs: ArrayList +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontGlyph.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontGlyph.kt new file mode 100644 index 000000000..86c68a856 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontGlyph.kt @@ -0,0 +1,18 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMFontGlyph( + charCode: String, + advance: KMVec2D, + boundingBoxSize: KMVec2D, + bearing: KMVec2D, + uv: KMQuad2dD, +) { + val charCode: String + val advance: KMVec2D + val boundingBoxSize: KMVec2D + val bearing: KMVec2D + val uv: KMQuad2dD +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderInterface.kt new file mode 100644 index 000000000..fd3fd1bd6 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMFontLoaderInterface { + + fun loadFont(font: KMFont): KMFontLoaderResult +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderResult.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderResult.kt new file mode 100644 index 000000000..dfe50b4a1 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderResult.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMFontLoaderResult( + imageData: KMTextureHolderInterface?, + fontData: KMFontData?, + status: KMLoaderStatus, +) { + val imageData: KMTextureHolderInterface? + val fontData: KMFontData? + val status: KMLoaderStatus +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontWrapper.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontWrapper.kt new file mode 100644 index 000000000..3124d1c50 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontWrapper.kt @@ -0,0 +1,20 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMFontWrapper( + name: String, + lineHeight: Double, + base: Double, + bitmapSize: KMVec2D, + size: Double, + distanceRange: Double, +) { + val name: String + val lineHeight: Double + val base: Double + val bitmapSize: KMVec2D + val size: Double + val distanceRange: Double +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFormattedStringEntry.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFormattedStringEntry.kt new file mode 100644 index 000000000..e12bc4f46 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFormattedStringEntry.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMFormattedStringEntry( + text: String, + scale: Float, +) { + val text: String + val scale: Float +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonFeatureParserInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonFeatureParserInterface.kt new file mode 100644 index 000000000..265c14b7d --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonFeatureParserInterface.kt @@ -0,0 +1,19 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from geo_json_parser.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMGeoJsonFeatureParserInterface constructor(nativeHandle: Any) { + + fun parse(geoJson: String): ArrayList? + + fun parseWithPointGeometry(geoJson: String): ArrayList? + + fun parseWithLineGeometry(geoJson: String): ArrayList? + + companion object + { + + fun create(): KMGeoJsonFeatureParserInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonHelperInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonHelperInterface.kt new file mode 100644 index 000000000..b713f040c --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonHelperInterface.kt @@ -0,0 +1,17 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from geo_json_parser.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMGeoJsonHelperInterface constructor(nativeHandle: Any) { + + fun geoJsonStringFromFeatureInfo(point: KMGeoJsonPoint): String + + fun geoJsonStringFromFeatureInfos(points: ArrayList): String + + companion object + { + + fun independentInstance(): KMGeoJsonHelperInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonLine.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonLine.kt new file mode 100644 index 000000000..5fd899ee3 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonLine.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from geo_json_parser.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMGeoJsonLine( + points: ArrayList, + featureInfo: KMVectorLayerFeatureInfo, +) { + val points: ArrayList + val featureInfo: KMVectorLayerFeatureInfo +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonPoint.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonPoint.kt new file mode 100644 index 000000000..126d9b241 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonPoint.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from geo_json_parser.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMGeoJsonPoint( + point: KMCoord, + featureInfo: KMVectorLayerFeatureInfo, +) { + val point: KMCoord + val featureInfo: KMVectorLayerFeatureInfo +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGlyphDescription.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGlyphDescription.kt new file mode 100644 index 000000000..6a1b4fd43 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGlyphDescription.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMGlyphDescription( + frame: KMQuad2dD, + textureCoordinates: KMQuad2dD, +) { + val frame: KMQuad2dD + val textureCoordinates: KMQuad2dD +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectFactoryInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectFactoryInterface.kt new file mode 100644 index 000000000..3ee2723e5 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectFactoryInterface.kt @@ -0,0 +1,37 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMGraphicsObjectFactoryInterface { + + fun createQuad(shader: KMShaderProgramInterface): KMQuad2dInterface + + fun createQuadTessellated(shader: KMShaderProgramInterface): KMQuad2dInterface + + fun createPolygon(shader: KMShaderProgramInterface): KMPolygon2dInterface + + fun createPolygonTessellated(shader: KMShaderProgramInterface): KMPolygon2dInterface + + fun createIcosahedronObject(shader: KMShaderProgramInterface): KMIcosahedronInterface + + fun createQuadInstanced(shader: KMShaderProgramInterface): KMQuad2dInstancedInterface + + fun createQuadStretchedInstanced(shader: KMShaderProgramInterface): KMQuad2dStretchedInstancedInterface + + fun createLineGroup(shader: KMShaderProgramInterface): KMLineGroup2dInterface + + fun createPolygonGroup(shader: KMShaderProgramInterface): KMPolygonGroup2dInterface + + fun createPolygonPatternGroup(shader: KMShaderProgramInterface): KMPolygonPatternGroup2dInterface + + fun createQuadMask(is3d: Boolean): KMQuad2dInterface + + fun createPolygonMask(is3d: Boolean): KMPolygon2dInterface + + fun createPolygonMaskTessellated(is3d: Boolean): KMPolygon2dInterface + + fun createText(shader: KMShaderProgramInterface): KMTextInterface + + fun createTextInstanced(shader: KMShaderProgramInterface): KMTextInstancedInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectInterface.kt new file mode 100644 index 000000000..a6631895c --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectInterface.kt @@ -0,0 +1,19 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMGraphicsObjectInterface { + + fun isReady(): Boolean + + fun setup(context: KMRenderingContextInterface) + + fun clear() + + fun setIsInverseMasked(inversed: Boolean) + + fun setDebugLabel(label: String) + + fun render(context: KMRenderingContextInterface, renderPass: KMRenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: KMVec3D, isMasked: Boolean, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconFactory.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconFactory.kt new file mode 100644 index 000000000..9895bea80 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconFactory.kt @@ -0,0 +1,15 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMIconFactory constructor(nativeHandle: Any) { + + companion object + { + + fun createIcon(identifier: String, coordinate: KMCoord, texture: KMTextureHolderInterface, iconSize: KMVec2F, scaleType: KMIconType, blendMode: KMBlendMode): KMIconInfoInterface + + fun createIconWithAnchor(identifier: String, coordinate: KMCoord, texture: KMTextureHolderInterface, iconSize: KMVec2F, scaleType: KMIconType, blendMode: KMBlendMode, iconAnchor: KMVec2F): KMIconInfoInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconInfoInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconInfoInterface.kt new file mode 100644 index 000000000..22c5e4129 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconInfoInterface.kt @@ -0,0 +1,27 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMIconInfoInterface constructor(nativeHandle: Any) { + + fun getIdentifier(): String + + fun getTexture(): KMTextureHolderInterface + + fun setCoordinate(coord: KMCoord) + + fun getCoordinate(): KMCoord + + fun setIconSize(size: KMVec2F) + + fun getIconSize(): KMVec2F + + fun setType(scaleType: KMIconType) + + fun getType(): KMIconType + + fun getIconAnchor(): KMVec2F + + fun getBlendMode(): KMBlendMode +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerCallbackInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerCallbackInterface.kt new file mode 100644 index 000000000..281eb1fa2 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerCallbackInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMIconLayerCallbackInterface { + + fun onClickConfirmed(icons: ArrayList): Boolean + + fun onLongPress(icons: ArrayList): Boolean +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerInterface.kt new file mode 100644 index 000000000..b232a0ed7 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerInterface.kt @@ -0,0 +1,43 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMIconLayerInterface constructor(nativeHandle: Any) { + + fun setIcons(icons: ArrayList) + + fun getIcons(): ArrayList + + fun remove(icon: KMIconInfoInterface) + + fun removeList(icons: ArrayList) + + fun removeIdentifier(identifier: String) + + fun removeIdentifierList(identifiers: ArrayList) + + fun add(icon: KMIconInfoInterface) + + fun addList(icons: ArrayList) + + fun clear() + + fun setCallbackHandler(handler: KMIconLayerCallbackInterface) + + fun asLayerInterface(): KMLayerInterface + + fun invalidate() + + fun setLayerClickable(isLayerClickable: Boolean) + + fun setRenderPassIndex(index: Int) + + fun animateIconScale(identifier: String, from: Float, to: Float, duration: Float, repetitions: Int) + + companion object + { + + fun create(): KMIconLayerInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconTextFit.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconTextFit.kt new file mode 100644 index 000000000..63245d5a5 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconTextFit.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMIconTextFit { + NONE, + WIDTH, + HEIGHT, + BOTH, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconType.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconType.kt new file mode 100644 index 000000000..894c6bb0c --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconType.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMIconType { + SCALE_INVARIANT, + ROTATION_INVARIANT, + INVARIANT, + FIXED, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronInterface.kt new file mode 100644 index 000000000..67089238f --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMIcosahedronInterface { + + fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) + + fun asGraphicsObject(): KMGraphicsObjectInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerCallbackInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerCallbackInterface.kt new file mode 100644 index 000000000..1ddad8fa9 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerCallbackInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icosahedron.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMIcosahedronLayerCallbackInterface { + + fun getData(): KMFuture +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerInterface.kt new file mode 100644 index 000000000..2b09fafb9 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerInterface.kt @@ -0,0 +1,15 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icosahedron.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMIcosahedronLayerInterface constructor(nativeHandle: Any) { + + fun asLayerInterface(): KMLayerInterface + + companion object + { + + fun create(callbackHandler: KMIcosahedronLayerCallbackInterface): KMIcosahedronLayerInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIndexedLayerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIndexedLayerInterface.kt new file mode 100644 index 000000000..151457d39 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIndexedLayerInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMIndexedLayerInterface { + + fun getLayerInterface(): KMLayerInterface + + fun getIndex(): Int +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerInterface.kt new file mode 100644 index 000000000..d54773662 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerInterface.kt @@ -0,0 +1,43 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMLayerInterface { + + fun setMaskingObject(maskingObject: KMMaskingObjectInterface?) + + fun update() + + fun buildRenderPasses(): ArrayList + + fun buildComputePasses(): ArrayList + + fun onAdded(mapInterface: KMMapInterface, layerIndex: Int) + + fun onRemoved() + + fun pause() + + fun resume() + + fun hide() + + fun show() + + fun setAlpha(alpha: Float) + + fun getAlpha(): Float + + fun setScissorRect(scissorRect: KMRectI?) + + fun isReadyToRenderOffscreen(): KMLayerReadyState + + fun enableAnimations(enabled: Boolean) + + fun setErrorManager(errorManager: KMErrorManager) + + fun forceReload() + + fun setPrimaryRenderTarget(target: KMRenderTargetInterface?) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerObjectInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerObjectInterface.kt new file mode 100644 index 000000000..421589459 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerObjectInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from layer_object.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMLayerObjectInterface constructor(nativeHandle: Any) { + + fun update() + + fun getRenderConfig(): ArrayList +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerReadyState.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerReadyState.kt new file mode 100644 index 000000000..6c74c345e --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerReadyState.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMLayerReadyState { + READY, + NOT_READY, + ERROR, + TIMEOUT_ERROR, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineCapType.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineCapType.kt new file mode 100644 index 000000000..5ed539e67 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineCapType.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMLineCapType { + BUTT, + ROUND, + SQUARE, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineFactory.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineFactory.kt new file mode 100644 index 000000000..37df20137 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineFactory.kt @@ -0,0 +1,13 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMLineFactory constructor(nativeHandle: Any) { + + companion object + { + + fun createLine(identifier: String, coordinates: ArrayList, style: KMLineStyle): KMLineInfoInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroup2dInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroup2dInterface.kt new file mode 100644 index 000000000..832dbb1da --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroup2dInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMLineGroup2dInterface { + + fun setLines(lines: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D, is3d: Boolean) + + fun asGraphicsObject(): KMGraphicsObjectInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroupShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroupShaderInterface.kt new file mode 100644 index 000000000..2dc8fbe0d --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroupShaderInterface.kt @@ -0,0 +1,13 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMLineGroupShaderInterface constructor(nativeHandle: Any) { + + fun setStyles(styles: KMSharedBytes) + + fun setDashingScaleFactor(factor: Float) + + fun asShaderProgramInterface(): KMShaderProgramInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineInfoInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineInfoInterface.kt new file mode 100644 index 000000000..1775ad6fc --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineInfoInterface.kt @@ -0,0 +1,13 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMLineInfoInterface constructor(nativeHandle: Any) { + + fun getIdentifier(): String + + fun getCoordinates(): ArrayList + + fun getStyle(): KMLineStyle +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineJoinType.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineJoinType.kt new file mode 100644 index 000000000..1b13972b4 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineJoinType.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMLineJoinType { + BEVEL, + ROUND, + MITER, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerCallbackInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerCallbackInterface.kt new file mode 100644 index 000000000..a06ab4467 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerCallbackInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMLineLayerCallbackInterface { + + fun onLineClickConfirmed(line: KMLineInfoInterface) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerInterface.kt new file mode 100644 index 000000000..7e31b678b --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerInterface.kt @@ -0,0 +1,37 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMLineLayerInterface constructor(nativeHandle: Any) { + + fun setLines(lines: ArrayList) + + fun getLines(): ArrayList + + fun remove(line: KMLineInfoInterface) + + fun add(line: KMLineInfoInterface) + + fun clear() + + fun setCallbackHandler(handler: KMLineLayerCallbackInterface) + + fun asLayerInterface(): KMLayerInterface + + fun invalidate() + + fun resetSelection() + + fun setSelected(selectedIds: HashSet) + + fun setLayerClickable(isLayerClickable: Boolean) + + fun setRenderPassIndex(index: Int) + + companion object + { + + fun create(): KMLineLayerInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineStyle.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineStyle.kt new file mode 100644 index 000000000..0ed87181d --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineStyle.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMLineStyle( + color: KMColorStateList, + gapColor: KMColorStateList, + opacity: Float, + blur: Float, + widthType: KMSizeType, + width: Float, + dashArray: ArrayList, + dashFade: Float, + dashAnimationSpeed: Float, + lineCap: KMLineCapType, + lineJoin: KMLineJoinType, + offset: Float, + dotted: Boolean, + dottedSkew: Float, +) { + val color: KMColorStateList + val gapColor: KMColorStateList + val opacity: Float + val blur: Float + val widthType: KMSizeType + val width: Float + val dashArray: ArrayList + val dashFade: Float + val dashAnimationSpeed: Float + val lineCap: KMLineCapType + val lineJoin: KMLineJoinType + val offset: Float + val dotted: Boolean + val dottedSkew: Float +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderInterface.kt new file mode 100644 index 000000000..5174a8c33 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderInterface.kt @@ -0,0 +1,17 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMLoaderInterface { + + fun loadTexture(url: String, etag: String?): KMTextureLoaderResult + + fun loadData(url: String, etag: String?): KMDataLoaderResult + + fun loadTextureAsync(url: String, etag: String?): KMFuture + + fun loadDataAsync(url: String, etag: String?): KMFuture + + fun cancel(url: String) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderStatus.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderStatus.kt new file mode 100644 index 000000000..d5c96d8c7 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderStatus.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMLoaderStatus { + OK, + NOOP, + ERROR_TIMEOUT, + ERROR_NETWORK, + ERROR_OTHER, + ERROR_400, + ERROR_404, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoggerData.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoggerData.kt new file mode 100644 index 000000000..cda2ed229 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoggerData.kt @@ -0,0 +1,26 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMLoggerData( + id: String, + buckets: ArrayList, + bucketSizeMs: Int, + start: Long, + end: Long, + numSamples: Long, + average: Double, + variance: Double, + stdDeviation: Double, +) { + val id: String + val buckets: ArrayList + val bucketSizeMs: Int + val start: Long + val end: Long + val numSamples: Long + val average: Double + val variance: Double + val stdDeviation: Double +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCallbackInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCallbackInterface.kt new file mode 100644 index 000000000..426c17bd9 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCallbackInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMMapCallbackInterface { + + fun invalidate() + + fun onMapResumed() +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCamera3dInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCamera3dInterface.kt new file mode 100644 index 000000000..477fbf407 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCamera3dInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMMapCamera3dInterface constructor(nativeHandle: Any) { + + fun getCameraConfig(): KMCamera3dConfig + + fun setCameraConfig(config: KMCamera3dConfig, durationSeconds: Float?, targetZoom: Float?, targetCoordinate: KMCoord?) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraInterface.kt new file mode 100644 index 000000000..02630a0e2 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraInterface.kt @@ -0,0 +1,107 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMMapCameraInterface constructor(nativeHandle: Any) { + + fun freeze(freeze: Boolean) + + fun moveToCenterPositionZoom(centerPosition: KMCoord, zoom: Double, animated: Boolean) + + fun moveToCenterPosition(centerPosition: KMCoord, animated: Boolean) + + fun moveToBoundingBox(boundingBox: KMRectCoord, paddingPc: Float, animated: Boolean, minZoom: Double?, maxZoom: Double?) + + fun getCenterPosition(): KMCoord + + fun setZoom(zoom: Double, animated: Boolean) + + fun getZoom(): Double + + fun setRotation(angle: Float, animated: Boolean) + + fun getRotation(): Float + + fun setMinZoom(minZoom: Double) + + fun setMaxZoom(maxZoom: Double) + + fun getMinZoom(): Double + + fun getMaxZoom(): Double + + fun setBounds(bounds: KMRectCoord) + + fun getBounds(): KMRectCoord + + fun isInBounds(coords: KMCoord): Boolean + + fun setPaddingLeft(padding: Float) + + fun setPaddingRight(padding: Float) + + fun setPaddingTop(padding: Float) + + fun setPaddingBottom(padding: Float) + + fun getVisibleRect(): KMRectCoord + + fun getPaddingAdjustedVisibleRect(): KMRectCoord + + fun getScreenDensityPpi(): Float + + fun update() + + fun getInvariantModelMatrix(coordinate: KMCoord, scaleInvariant: Boolean, rotationInvariant: Boolean): ArrayList + + fun addListener(listener: KMMapCameraListenerInterface) + + fun removeListener(listener: KMMapCameraListenerInterface) + + fun notifyListenerBoundsChange() + + fun coordFromScreenPosition(posScreen: KMVec2F): KMCoord + + fun coordFromScreenPositionZoom(posScreen: KMVec2F, zoom: Float): KMCoord + + fun screenPosFromCoord(coord: KMCoord): KMVec2F + + fun screenPosFromCoordZoom(coord: KMCoord, zoom: Float): KMVec2F + + fun mapUnitsFromPixels(distancePx: Double): Double + + fun getScalingFactor(): Double + + fun coordIsVisibleOnScreen(coord: KMCoord, paddingPc: Float): Boolean + + fun setRotationEnabled(enabled: Boolean) + + fun setSnapToNorthEnabled(enabled: Boolean) + + fun setBoundsRestrictWholeVisibleRect(enabled: Boolean) + + fun asCameraInterface(): KMCameraInterface + + fun getLastVpMatrixD(): ArrayList? + + fun getLastVpMatrix(): ArrayList? + + fun getLastInverseVpMatrix(): ArrayList? + + fun getLastVpMatrixViewBounds(): KMRectCoord? + + fun getLastVpMatrixRotation(): Float? + + fun getLastVpMatrixZoom(): Float? + + fun getLastCameraPosition(): KMVec3D? + + fun asMapCamera3d(): KMMapCamera3dInterface? + + companion object + { + + fun create(mapInterface: KMMapInterface, screenDensityPpi: Float, is3D: Boolean): KMMapCameraInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraListenerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraListenerInterface.kt new file mode 100644 index 000000000..7d09a791a --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraListenerInterface.kt @@ -0,0 +1,15 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from camera.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMMapCameraListenerInterface { + + fun onVisibleBoundsChanged(visibleBounds: KMRectCoord, zoom: Double) + + fun onRotationChanged(angle: Float) + + fun onMapInteraction() + + fun onCameraChange(viewMatrix: ArrayList, projectionMatrix: ArrayList, origin: KMVec3D, verticalFov: Float, horizontalFov: Float, width: Float, height: Float, focusPointAltitude: Float, focusPointPosition: KMCoord, zoom: Float) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapConfig.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapConfig.kt new file mode 100644 index 000000000..595a6a65b --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapConfig.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMMapConfig( + mapCoordinateSystem: KMMapCoordinateSystem, +) { + val mapCoordinateSystem: KMMapCoordinateSystem +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCoordinateSystem.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCoordinateSystem.kt new file mode 100644 index 000000000..595b49fe3 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCoordinateSystem.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMMapCoordinateSystem( + identifier: Int, + bounds: KMRectCoord, + unitToScreenMeterFactor: Float, +) { + val identifier: Int + val bounds: KMRectCoord + val unitToScreenMeterFactor: Float +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterface.kt new file mode 100644 index 000000000..d7e7562e4 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterface.kt @@ -0,0 +1,85 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMMapInterface constructor(nativeHandle: Any) { + + fun setCallbackHandler(callbackInterface: KMMapCallbackInterface?) + + fun getGraphicsObjectFactory(): KMGraphicsObjectFactoryInterface + + fun getShaderFactory(): KMShaderFactoryInterface + + fun getScheduler(): KMSchedulerInterface + + fun getRenderingContext(): KMRenderingContextInterface + + fun getMapConfig(): KMMapConfig + + fun getCoordinateConverterHelper(): KMCoordinateConversionHelperInterface + + fun setCamera(camera: KMMapCameraInterface) + + fun getCamera(): KMMapCameraInterface + + fun setTouchHandler(touchHandler: KMTouchHandlerInterface) + + fun getTouchHandler(): KMTouchHandlerInterface + + fun setPerformanceLoggers(performanceLoggers: ArrayList) + + fun getPerformanceLoggers(): ArrayList + + fun getLayers(): ArrayList + + fun getLayersIndexed(): ArrayList + + fun addLayer(layer: KMLayerInterface) + + fun insertLayerAt(layer: KMLayerInterface, atIndex: Int) + + fun insertLayerAbove(layer: KMLayerInterface, above: KMLayerInterface) + + fun insertLayerBelow(layer: KMLayerInterface, below: KMLayerInterface) + + fun removeLayer(layer: KMLayerInterface) + + fun setViewportSize(size: KMVec2I) + + fun setBackgroundColor(color: KMColor) + + fun is3d(): Boolean + + fun invalidate() + + fun resetIsInvalidated() + + fun prepare() + + fun getNeedsCompute(): Boolean + + fun drawOffscreenFrame(target: KMRenderTargetInterface) + + fun drawFrame() + + fun compute() + + fun resume() + + fun pause() + + fun destroy() + + fun drawReadyFrame(bounds: KMRectCoord, paddingPc: Float, timeout: Float, callbacks: KMMapReadyCallbackInterface) + + fun forceReload() + + companion object + { + + fun create(graphicsFactory: KMGraphicsObjectFactoryInterface, shaderFactory: KMShaderFactoryInterface, renderingContext: KMRenderingContextInterface, mapConfig: KMMapConfig, scheduler: KMSchedulerInterface, pixelDensity: Float, is3D: Boolean): KMMapInterface + + fun createWithOpenGl(mapConfig: KMMapConfig, scheduler: KMSchedulerInterface, pixelDensity: Float, is3D: Boolean): KMMapInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapReadyCallbackInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapReadyCallbackInterface.kt new file mode 100644 index 000000000..b117cb210 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapReadyCallbackInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMMapReadyCallbackInterface { + + fun stateDidUpdate(state: KMLayerReadyState) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapsCoreSharedModule.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapsCoreSharedModule.kt new file mode 100644 index 000000000..4463160ef --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapsCoreSharedModule.kt @@ -0,0 +1,13 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from maps_core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMMapsCoreSharedModule constructor(nativeHandle: Any) { + + companion object + { + + fun version(): String + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMaskingObjectInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMaskingObjectInterface.kt new file mode 100644 index 000000000..67c9d0f2c --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMaskingObjectInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMMaskingObjectInterface { + + fun asGraphicsObject(): KMGraphicsObjectInterface + + fun renderAsMask(context: KMRenderingContextInterface, renderPass: KMRenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlPerformanceLoggerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlPerformanceLoggerInterface.kt new file mode 100644 index 000000000..1e47fa295 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlPerformanceLoggerInterface.kt @@ -0,0 +1,17 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMOpenGlPerformanceLoggerInterface constructor(nativeHandle: Any) { + + fun asPerformanceLoggerInterface(): KMPerformanceLoggerInterface + + companion object + { + + fun create(): KMOpenGlPerformanceLoggerInterface + + fun createSpecifically(numBuckets: Int, bucketSizeMs: Long): KMOpenGlPerformanceLoggerInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderTargetInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderTargetInterface.kt new file mode 100644 index 000000000..52daa5025 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderTargetInterface.kt @@ -0,0 +1,19 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMOpenGlRenderTargetInterface { + + fun asRenderTargetInterface(): KMRenderTargetInterface + + fun setup(size: KMVec2I) + + fun clear() + + fun bindFramebuffer(renderingContext: KMRenderingContextInterface) + + fun unbindFramebuffer() + + fun getTextureId(): Int +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderingContextInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderingContextInterface.kt new file mode 100644 index 000000000..161bbccd4 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderingContextInterface.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMOpenGlRenderingContextInterface { + + fun resume() + + fun pause() + + fun getCreateRenderTarget(name: String, textureFilter: KMTextureFilterType, clearColor: KMColor, usesDepthStencil: Boolean): KMOpenGlRenderTargetInterface + + fun deleteRenderTarget(name: String) + + fun getRenderTargets(): ArrayList + + fun getProgram(name: String): Int + + fun storeProgram(name: String, program: Int) + + fun getAspectRatio(): Float + + fun getDeltaTimeMs(): Long +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPerformanceLoggerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPerformanceLoggerInterface.kt new file mode 100644 index 000000000..b95922941 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPerformanceLoggerInterface.kt @@ -0,0 +1,21 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMPerformanceLoggerInterface { + + fun getLoggerName(): String + + fun startLog(id: String) + + fun endLog(id: String) + + fun getStatistics(id: String): KMLoggerData? + + fun getAllStatistics(): ArrayList + + fun resetData() + + fun setLoggingEnabled(enabled: Boolean) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygon2dInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygon2dInterface.kt new file mode 100644 index 000000000..294c8faf0 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygon2dInterface.kt @@ -0,0 +1,15 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMPolygon2dInterface { + + fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D, is3d: Boolean) + + fun setSubdivisionFactor(factor: Int) + + fun asGraphicsObject(): KMGraphicsObjectInterface + + fun asMaskingObject(): KMMaskingObjectInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonCoord.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonCoord.kt new file mode 100644 index 000000000..426743ce5 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonCoord.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMPolygonCoord( + positions: ArrayList, + holes: ArrayList>, +) { + val positions: ArrayList + val holes: ArrayList> +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroup2dInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroup2dInterface.kt new file mode 100644 index 000000000..fe7c3af07 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroup2dInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMPolygonGroup2dInterface { + + fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) + + fun asGraphicsObject(): KMGraphicsObjectInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroupShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroupShaderInterface.kt new file mode 100644 index 000000000..c08848e48 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroupShaderInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMPolygonGroupShaderInterface constructor(nativeHandle: Any) { + + fun setStyles(styles: KMSharedBytes) + + fun asShaderProgramInterface(): KMShaderProgramInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonInfo.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonInfo.kt new file mode 100644 index 000000000..f347b7917 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonInfo.kt @@ -0,0 +1,16 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMPolygonInfo( + identifier: String, + coordinates: KMPolygonCoord, + color: KMColor, + highlightColor: KMColor, +) { + val identifier: String + val coordinates: KMPolygonCoord + val color: KMColor + val highlightColor: KMColor +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerCallbackInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerCallbackInterface.kt new file mode 100644 index 000000000..251d43f0e --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerCallbackInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMPolygonLayerCallbackInterface { + + fun onClickConfirmed(polygon: KMPolygonInfo): Boolean + + fun onClickUnconfirmed(polygon: KMPolygonInfo): Boolean +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerInterface.kt new file mode 100644 index 000000000..db3288a56 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerInterface.kt @@ -0,0 +1,35 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMPolygonLayerInterface constructor(nativeHandle: Any) { + + fun setPolygons(polygons: ArrayList, origin: KMVec3D) + + fun getPolygons(): ArrayList + + fun remove(polygon: KMPolygonInfo) + + fun add(polygon: KMPolygonInfo) + + fun addAll(polygons: ArrayList) + + fun clear() + + fun setCallbackHandler(handler: KMPolygonLayerCallbackInterface) + + fun asLayerInterface(): KMLayerInterface + + fun resetSelection() + + fun setLayerClickable(isLayerClickable: Boolean) + + fun setRenderPassIndex(index: Int) + + companion object + { + + fun create(): KMPolygonLayerInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonMaskObjectInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonMaskObjectInterface.kt new file mode 100644 index 000000000..550f6ce36 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonMaskObjectInterface.kt @@ -0,0 +1,19 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMPolygonMaskObjectInterface constructor(nativeHandle: Any) { + + fun setPolygons(polygons: ArrayList, origin: KMVec3D) + + fun setPolygon(polygon: KMPolygonCoord, origin: KMVec3D) + + fun getPolygonObject(): KMPolygon2dInterface + + companion object + { + + fun create(graphicsObjectFactory: KMGraphicsObjectFactoryInterface, conversionHelper: KMCoordinateConversionHelperInterface, is3d: Boolean): KMPolygonMaskObjectInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroup2dInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroup2dInterface.kt new file mode 100644 index 000000000..edc10913e --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroup2dInterface.kt @@ -0,0 +1,23 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMPolygonPatternGroup2dInterface { + + fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) + + fun setOpacities(values: KMSharedBytes) + + fun setTextureCoordinates(values: KMSharedBytes) + + fun setScalingFactor(factor: Float) + + fun setScalingFactors(factor: KMVec2F) + + fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + fun removeTexture() + + fun asGraphicsObject(): KMGraphicsObjectInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroupShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroupShaderInterface.kt new file mode 100644 index 000000000..2bf16d67c --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroupShaderInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMPolygonPatternGroupShaderInterface constructor(nativeHandle: Any) { + + fun asShaderProgramInterface(): KMShaderProgramInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonStyle.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonStyle.kt new file mode 100644 index 000000000..4a985bf6a --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonStyle.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMPolygonStyle( + color: KMColor, + opacity: Float, +) { + val color: KMColor + val opacity: Float +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dD.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dD.kt new file mode 100644 index 000000000..7618ef971 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dD.kt @@ -0,0 +1,16 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMQuad2dD( + topLeft: KMVec2D, + topRight: KMVec2D, + bottomRight: KMVec2D, + bottomLeft: KMVec2D, +) { + val topLeft: KMVec2D + val topRight: KMVec2D + val bottomRight: KMVec2D + val bottomLeft: KMVec2D +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInstancedInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInstancedInterface.kt new file mode 100644 index 000000000..fa17ac824 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInstancedInterface.kt @@ -0,0 +1,31 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMQuad2dInstancedInterface { + + fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) + + fun setInstanceCount(count: Int) + + fun setPositions(positions: KMSharedBytes) + + fun setScales(scales: KMSharedBytes) + + fun setRotations(rotations: KMSharedBytes) + + fun setAlphas(values: KMSharedBytes) + + fun setTextureCoordinates(textureCoordinates: KMSharedBytes) + + fun setPositionOffset(offsets: KMSharedBytes) + + fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + fun removeTexture() + + fun asGraphicsObject(): KMGraphicsObjectInterface + + fun asMaskingObject(): KMMaskingObjectInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInterface.kt new file mode 100644 index 000000000..864088dbb --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInterface.kt @@ -0,0 +1,21 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMQuad2dInterface { + + fun setFrame(frame: KMQuad3dD, textureCoordinates: KMRectD, origin: KMVec3D, is3d: Boolean) + + fun setSubdivisionFactor(factor: Int) + + fun setMinMagFilter(filterType: KMTextureFilterType) + + fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + fun removeTexture() + + fun asGraphicsObject(): KMGraphicsObjectInterface + + fun asMaskingObject(): KMMaskingObjectInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dStretchedInstancedInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dStretchedInstancedInterface.kt new file mode 100644 index 000000000..f315f3183 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dStretchedInstancedInterface.kt @@ -0,0 +1,31 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMQuad2dStretchedInstancedInterface { + + fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) + + fun setInstanceCount(count: Int) + + fun setPositions(positions: KMSharedBytes) + + fun setScales(scales: KMSharedBytes) + + fun setRotations(rotations: KMSharedBytes) + + fun setAlphas(values: KMSharedBytes) + + fun setStretchInfos(values: KMSharedBytes) + + fun setTextureCoordinates(textureCoordinates: KMSharedBytes) + + fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + fun removeTexture() + + fun asGraphicsObject(): KMGraphicsObjectInterface + + fun asMaskingObject(): KMMaskingObjectInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad3dD.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad3dD.kt new file mode 100644 index 000000000..e75a62574 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad3dD.kt @@ -0,0 +1,16 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMQuad3dD( + topLeft: KMVec3D, + topRight: KMVec3D, + bottomRight: KMVec3D, + bottomLeft: KMVec3D, +) { + val topLeft: KMVec3D + val topRight: KMVec3D + val bottomRight: KMVec3D + val bottomLeft: KMVec3D +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuadCoord.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuadCoord.kt new file mode 100644 index 000000000..43fc0f4c4 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuadCoord.kt @@ -0,0 +1,16 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMQuadCoord( + topLeft: KMCoord, + topRight: KMCoord, + bottomRight: KMCoord, + bottomLeft: KMCoord, +) { + val topLeft: KMCoord + val topRight: KMCoord + val bottomRight: KMCoord + val bottomLeft: KMCoord +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderInterface.kt new file mode 100644 index 000000000..b8f9e6fdd --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMRasterShaderInterface constructor(nativeHandle: Any) { + + fun setStyle(style: KMRasterShaderStyle) + + fun asShaderProgramInterface(): KMShaderProgramInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderStyle.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderStyle.kt new file mode 100644 index 000000000..c8a319b49 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderStyle.kt @@ -0,0 +1,22 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMRasterShaderStyle( + opacity: Float, + brightnessMin: Float, + brightnessMax: Float, + contrast: Float, + saturation: Float, + gamma: Float, + brightnessShift: Float, +) { + val opacity: Float + val brightnessMin: Float + val brightnessMax: Float + val contrast: Float + val saturation: Float + val gamma: Float + val brightnessShift: Float +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectCoord.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectCoord.kt new file mode 100644 index 000000000..2d5a4c5df --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectCoord.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMRectCoord( + topLeft: KMCoord, + bottomRight: KMCoord, +) { + val topLeft: KMCoord + val bottomRight: KMCoord +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectD.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectD.kt new file mode 100644 index 000000000..641bb7436 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectD.kt @@ -0,0 +1,16 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMRectD( + x: Double, + y: Double, + width: Double, + height: Double, +) { + val x: Double + val y: Double + val width: Double + val height: Double +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectF.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectF.kt new file mode 100644 index 000000000..040102dfb --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectF.kt @@ -0,0 +1,16 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMRectF( + x: Float, + y: Float, + width: Float, + height: Float, +) { + val x: Float + val y: Float + val width: Float + val height: Float +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectI.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectI.kt new file mode 100644 index 000000000..76b55183a --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectI.kt @@ -0,0 +1,16 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMRectI( + x: Int, + y: Int, + width: Int, + height: Int, +) { + val x: Int + val y: Int + val width: Int + val height: Int +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePacker.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePacker.kt new file mode 100644 index 000000000..a8ef7ba46 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePacker.kt @@ -0,0 +1,13 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from packer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMRectanglePacker constructor(nativeHandle: Any) { + + companion object + { + + fun pack(rectangles: HashMap, maxPageSize: KMVec2I, spacing: Int): ArrayList + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePackerPage.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePackerPage.kt new file mode 100644 index 000000000..9879f4564 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePackerPage.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from packer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMRectanglePackerPage( + uvs: HashMap, +) { + val uvs: HashMap +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderConfigInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderConfigInterface.kt new file mode 100644 index 000000000..61496e5ae --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderConfigInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from layer_object.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMRenderConfigInterface constructor(nativeHandle: Any) { + + fun getGraphicsObject(): KMGraphicsObjectInterface + + fun getRenderIndex(): Int +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderLineDescription.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderLineDescription.kt new file mode 100644 index 000000000..b61c89c97 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderLineDescription.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMRenderLineDescription( + positions: ArrayList, + styleIndex: Int, +) { + val positions: ArrayList + val styleIndex: Int +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderObjectInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderObjectInterface.kt new file mode 100644 index 000000000..036b32593 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderObjectInterface.kt @@ -0,0 +1,19 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMRenderObjectInterface { + + fun getGraphicsObject(): KMGraphicsObjectInterface + + fun hasCustomModelMatrix(): Boolean + + fun isScreenSpaceCoords(): Boolean + + fun getCustomModelMatrix(): ArrayList + + fun setHidden(hidden: Boolean) + + fun isHidden(): Boolean +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassConfig.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassConfig.kt new file mode 100644 index 000000000..c2f758384 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassConfig.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMRenderPassConfig( + renderPassIndex: Int, + isPassMasked: Boolean, + renderTarget: KMRenderTargetInterface?, +) { + val renderPassIndex: Int + val isPassMasked: Boolean + val renderTarget: KMRenderTargetInterface? +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassInterface.kt new file mode 100644 index 000000000..52844cd74 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassInterface.kt @@ -0,0 +1,17 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMRenderPassInterface { + + fun getRenderObjects(): ArrayList + + fun addRenderObject(renderObject: KMRenderObjectInterface) + + fun getRenderPassConfig(): KMRenderPassConfig + + fun getMaskingObject(): KMMaskingObjectInterface? + + fun getScissoringRect(): KMRectI? +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderTargetInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderTargetInterface.kt new file mode 100644 index 000000000..223e3217f --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderTargetInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMRenderTargetInterface { + + fun asGlRenderTargetInterface(): KMOpenGlRenderTargetInterface? +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderVerticesDescription.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderVerticesDescription.kt new file mode 100644 index 000000000..4509d227e --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderVerticesDescription.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMRenderVerticesDescription( + vertices: ArrayList, + styleIndex: Int, +) { + val vertices: ArrayList + val styleIndex: Int +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRendererInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRendererInterface.kt new file mode 100644 index 000000000..b3c51e8f3 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRendererInterface.kt @@ -0,0 +1,15 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMRendererInterface { + + fun addToRenderQueue(renderPass: KMRenderPassInterface) + + fun addToComputeQueue(computePass: KMComputePassInterface) + + fun drawFrame(renderingContext: KMRenderingContextInterface, camera: KMCameraInterface, target: KMRenderTargetInterface?) + + fun compute(renderingContext: KMRenderingContextInterface, camera: KMCameraInterface) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingContextInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingContextInterface.kt new file mode 100644 index 000000000..23dea0893 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingContextInterface.kt @@ -0,0 +1,27 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMRenderingContextInterface { + + fun onSurfaceCreated() + + fun setViewportSize(size: KMVec2I) + + fun getViewportSize(): KMVec2I + + fun setBackgroundColor(color: KMColor) + + fun setCulling(mode: KMRenderingCullMode) + + fun setupDrawFrame(vpMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double) + + fun preRenderStencilMask() + + fun postRenderStencilMask() + + fun applyScissorRect(scissorRect: KMRectI?) + + fun asOpenGlRenderingContext(): KMOpenGlRenderingContextInterface? +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingCullMode.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingCullMode.kt new file mode 100644 index 000000000..23507151b --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingCullMode.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMRenderingCullMode { + FRONT, + BACK, + NONE, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMReverseGeocoderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMReverseGeocoderInterface.kt new file mode 100644 index 000000000..9989d3a0c --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMReverseGeocoderInterface.kt @@ -0,0 +1,17 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from reverse_geocoder.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMReverseGeocoderInterface constructor(nativeHandle: Any) { + + fun reverseGeocode(coord: KMCoord, thresholdMeters: Long): ArrayList + + fun reverseGeocodeClosest(coord: KMCoord, thresholdMeters: Long): KMVectorLayerFeatureCoordInfo? + + companion object + { + + fun create(loader: KMLoaderInterface, tileUrlTemplate: String, zoomLevel: Int): KMReverseGeocoderInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneCallbackInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneCallbackInterface.kt new file mode 100644 index 000000000..12df7950b --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneCallbackInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMSceneCallbackInterface { + + fun invalidate() +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneInterface.kt new file mode 100644 index 000000000..8613f4e76 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneInterface.kt @@ -0,0 +1,39 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMSceneInterface constructor(nativeHandle: Any) { + + fun setCallbackHandler(callbackInterface: KMSceneCallbackInterface) + + fun setCamera(camera: KMCameraInterface) + + fun getCamera(): KMCameraInterface + + fun getRenderer(): KMRendererInterface + + fun getRenderingContext(): KMRenderingContextInterface + + fun getGraphicsFactory(): KMGraphicsObjectFactoryInterface + + fun getShaderFactory(): KMShaderFactoryInterface + + fun prepare() + + fun drawFrame(target: KMRenderTargetInterface?) + + fun compute() + + fun clear() + + fun invalidate() + + companion object + { + + fun create(graphicsFactory: KMGraphicsObjectFactoryInterface, shaderFactory: KMShaderFactoryInterface, renderingContext: KMRenderingContextInterface): KMSceneInterface + + fun createWithOpenGl(): KMSceneInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerGraphicsTaskCallbacks.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerGraphicsTaskCallbacks.kt new file mode 100644 index 000000000..13334dda2 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerGraphicsTaskCallbacks.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMSchedulerGraphicsTaskCallbacks constructor(nativeHandle: Any) { + + fun requestGraphicsTaskExecution() +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerInterface.kt new file mode 100644 index 000000000..35bff3149 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerInterface.kt @@ -0,0 +1,27 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMSchedulerInterface { + + fun addTask(task: KMTaskInterface) + + fun addTasks(tasks: ArrayList) + + fun removeTask(id: String) + + fun clear() + + fun pause() + + fun resume() + + fun destroy() + + fun hasSeparateGraphicsInvocation(): Boolean + + fun runGraphicsTasks(): Boolean + + fun setSchedulerGraphicsTaskCallbacks(callbacks: KMSchedulerGraphicsTaskCallbacks) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderFactoryInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderFactoryInterface.kt new file mode 100644 index 000000000..8e0c5a5ae --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderFactoryInterface.kt @@ -0,0 +1,61 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMShaderFactoryInterface { + + fun createAlphaShader(): KMAlphaShaderInterface + + fun createUnitSphereAlphaShader(): KMAlphaShaderInterface + + fun createAlphaInstancedShader(): KMAlphaInstancedShaderInterface + + fun createUnitSphereAlphaInstancedShader(): KMAlphaInstancedShaderInterface + + fun createLineGroupShader(): KMLineGroupShaderInterface + + fun createUnitSphereLineGroupShader(): KMLineGroupShaderInterface + + fun createSimpleLineGroupShader(): KMLineGroupShaderInterface + + fun createUnitSphereSimpleLineGroupShader(): KMLineGroupShaderInterface + + fun createUnitSphereColorShader(): KMColorShaderInterface + + fun createColorShader(): KMColorShaderInterface + + fun createPolygonTessellatedShader(unitSphere: Boolean): KMColorShaderInterface + + fun createColorCircleShader(): KMColorCircleShaderInterface + + fun createUnitSphereColorCircleShader(): KMColorCircleShaderInterface + + fun createPolygonGroupShader(isStriped: Boolean, unitSphere: Boolean): KMPolygonGroupShaderInterface + + fun createPolygonPatternGroupShader(fadeInPattern: Boolean, unitSphere: Boolean): KMPolygonPatternGroupShaderInterface + + fun createTextShader(): KMTextShaderInterface + + fun createTextInstancedShader(): KMTextInstancedShaderInterface + + fun createUnitSphereTextInstancedShader(): KMTextInstancedShaderInterface + + fun createRasterShader(): KMRasterShaderInterface + + fun createUnitSphereRasterShader(): KMRasterShaderInterface + + fun createQuadTessellatedShader(): KMRasterShaderInterface + + fun createStretchShader(): KMStretchShaderInterface + + fun createStretchInstancedShader(unitSphere: Boolean): KMStretchInstancedShaderInterface + + fun createIcosahedronColorShader(): KMColorShaderInterface + + fun createSphereEffectShader(): KMSphereEffectShaderInterface + + fun createSkySphereShader(): KMSkySphereShaderInterface + + fun createElevationInterpolationShader(): KMElevationInterpolationShaderInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderProgramInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderProgramInterface.kt new file mode 100644 index 000000000..07ea17875 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderProgramInterface.kt @@ -0,0 +1,17 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMShaderProgramInterface constructor(nativeHandle: Any) { + + fun getProgramName(): String + + fun setupProgram(context: KMRenderingContextInterface) + + fun preRender(context: KMRenderingContextInterface, isScreenSpaceCoords: Boolean) + + fun setBlendMode(blendMode: KMBlendMode) + + fun usesModelMatrix(): Boolean +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSharedBytes.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSharedBytes.kt new file mode 100644 index 000000000..5323e4d38 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSharedBytes.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMSharedBytes( + address: Long, + elementCount: Int, + bytesPerElement: Int, +) { + val address: Long + val elementCount: Int + val bytesPerElement: Int +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSizeType.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSizeType.kt new file mode 100644 index 000000000..5e39241e9 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSizeType.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from styling.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMSizeType { + SCREEN_PIXEL, + MAP_UNIT, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereLayerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereLayerInterface.kt new file mode 100644 index 000000000..c1d4b231b --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereLayerInterface.kt @@ -0,0 +1,17 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from sky_sphere.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMSkySphereLayerInterface constructor(nativeHandle: Any) { + + fun asLayerInterface(): KMLayerInterface + + fun setTexture(texture: KMTextureHolderInterface) + + companion object + { + + fun create(): KMSkySphereLayerInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereShaderInterface.kt new file mode 100644 index 000000000..082c12480 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereShaderInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMSkySphereShaderInterface constructor(nativeHandle: Any) { + + fun asShaderProgramInterface(): KMShaderProgramInterface + + fun setCameraProperties(inverseVP: ArrayList, cameraPosition: KMVec3D) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectLayerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectLayerInterface.kt new file mode 100644 index 000000000..88b1dbf51 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectLayerInterface.kt @@ -0,0 +1,15 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from sphere_effect.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMSphereEffectLayerInterface constructor(nativeHandle: Any) { + + fun asLayerInterface(): KMLayerInterface + + companion object + { + + fun create(): KMSphereEffectLayerInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectShaderInterface.kt new file mode 100644 index 000000000..d487e1e1d --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectShaderInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMSphereEffectShaderInterface constructor(nativeHandle: Any) { + + fun asShaderProgramInterface(): KMShaderProgramInterface + + fun setEllipse(coefficients: KMSharedBytes) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchInstancedShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchInstancedShaderInterface.kt new file mode 100644 index 000000000..e80fbf611 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchInstancedShaderInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMStretchInstancedShaderInterface constructor(nativeHandle: Any) { + + fun asShaderProgramInterface(): KMShaderProgramInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInfo.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInfo.kt new file mode 100644 index 000000000..ce27fc530 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInfo.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMStretchShaderInfo( + scaleX: Float, + stretchX0Begin: Float, + stretchX0End: Float, + stretchX1Begin: Float, + stretchX1End: Float, + scaleY: Float, + stretchY0Begin: Float, + stretchY0End: Float, + stretchY1Begin: Float, + stretchY1End: Float, + uv: KMRectD, +) { + val scaleX: Float + val stretchX0Begin: Float + val stretchX0End: Float + val stretchX1Begin: Float + val stretchX1End: Float + val scaleY: Float + val stretchY0Begin: Float + val stretchY0End: Float + val stretchY1Begin: Float + val stretchY1End: Float + val uv: KMRectD +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInterface.kt new file mode 100644 index 000000000..479f2f737 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInterface.kt @@ -0,0 +1,13 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMStretchShaderInterface constructor(nativeHandle: Any) { + + fun updateAlpha(value: Float) + + fun updateStretchInfo(info: KMStretchShaderInfo) + + fun asShaderProgramInterface(): KMShaderProgramInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolAlignment.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolAlignment.kt new file mode 100644 index 000000000..94c681412 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolAlignment.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMSymbolAlignment { + MAP, + VIEWPORT, + AUTO, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolZOrder.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolZOrder.kt new file mode 100644 index 000000000..1c2aeca40 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolZOrder.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMSymbolZOrder { + AUTO, + VIEWPORT_Y, + SOURCE, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskConfig.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskConfig.kt new file mode 100644 index 000000000..aef9e5cc6 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskConfig.kt @@ -0,0 +1,16 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTaskConfig( + id: String, + delay: Long, + priority: KMTaskPriority, + executionEnvironment: KMExecutionEnvironment, +) { + val id: String + val delay: Long + val priority: KMTaskPriority + val executionEnvironment: KMExecutionEnvironment +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskInterface.kt new file mode 100644 index 000000000..8e886427f --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMTaskInterface { + + fun getConfig(): KMTaskConfig + + fun run() +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskPriority.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskPriority.kt new file mode 100644 index 000000000..507a25188 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskPriority.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMTaskPriority { + HIGH, + NORMAL, + LOW, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTessellationMode.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTessellationMode.kt new file mode 100644 index 000000000..292ad61f6 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTessellationMode.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMTessellationMode { + NONE, + QUAD, + TRIANGLE, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextDescription.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextDescription.kt new file mode 100644 index 000000000..0af7b6d1f --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextDescription.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTextDescription( + glyphs: ArrayList, +) { + val glyphs: ArrayList +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextFactory.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextFactory.kt new file mode 100644 index 000000000..b2403530f --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextFactory.kt @@ -0,0 +1,13 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTextFactory constructor(nativeHandle: Any) { + + companion object + { + + fun createText(text: ArrayList, coordinate: KMCoord, font: KMFont, textAnchor: KMAnchor, textJustify: KMTextJustify): KMTextInfoInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInfoInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInfoInterface.kt new file mode 100644 index 000000000..6a1e0377a --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInfoInterface.kt @@ -0,0 +1,21 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMTextInfoInterface { + + fun getText(): ArrayList + + fun getCoordinate(): KMCoord + + fun getFont(): KMFont + + fun getTextAnchor(): KMAnchor + + fun getTextJustify(): KMTextJustify + + fun getSymbolPlacement(): KMTextSymbolPlacement + + fun getLineCoordinates(): ArrayList? +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedInterface.kt new file mode 100644 index 000000000..b810ad74e --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedInterface.kt @@ -0,0 +1,33 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMTextInstancedInterface { + + fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) + + fun setInstanceCount(count: Int) + + fun setPositions(positions: KMSharedBytes) + + fun setReferencePositions(positions: KMSharedBytes) + + fun setTextureCoordinates(textureCoordinates: KMSharedBytes) + + fun setScales(scales: KMSharedBytes) + + fun setRotations(rotations: KMSharedBytes) + + fun setAlphas(alphas: KMSharedBytes) + + fun setStyleIndices(indices: KMSharedBytes) + + fun setStyles(values: KMSharedBytes) + + fun loadFont(context: KMRenderingContextInterface, fontData: KMFontData, fontMsdfTexture: KMTextureHolderInterface) + + fun removeTexture() + + fun asGraphicsObject(): KMGraphicsObjectInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedShaderInterface.kt new file mode 100644 index 000000000..900775089 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedShaderInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTextInstancedShaderInterface constructor(nativeHandle: Any) { + + fun asShaderProgramInterface(): KMShaderProgramInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInterface.kt new file mode 100644 index 000000000..1f10c7370 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInterface.kt @@ -0,0 +1,15 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMTextInterface { + + fun setTextsShared(vertices: KMSharedBytes, indices: KMSharedBytes) + + fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + fun removeTexture() + + fun asGraphicsObject(): KMGraphicsObjectInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextJustify.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextJustify.kt new file mode 100644 index 000000000..19922bf71 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextJustify.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMTextJustify { + AUTO, + LEFT, + CENTER, + RIGHT, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextLayerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextLayerInterface.kt new file mode 100644 index 000000000..66e3334ef --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextLayerInterface.kt @@ -0,0 +1,19 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTextLayerInterface constructor(nativeHandle: Any) { + + fun setTexts(texts: ArrayList) + + fun asLayerInterface(): KMLayerInterface + + fun invalidate() + + companion object + { + + fun create(fontLoader: KMFontLoaderInterface): KMTextLayerInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextShaderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextShaderInterface.kt new file mode 100644 index 000000000..00c3e724b --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextShaderInterface.kt @@ -0,0 +1,15 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTextShaderInterface constructor(nativeHandle: Any) { + + fun setColor(color: KMColor) + + fun setOpacity(opacity: Float) + + fun setHaloColor(color: KMColor, width: Float, blur: Float) + + fun asShaderProgramInterface(): KMShaderProgramInterface +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextSymbolPlacement.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextSymbolPlacement.kt new file mode 100644 index 000000000..9d1d5e766 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextSymbolPlacement.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMTextSymbolPlacement { + POINT, + LINE, + LINE_CENTER, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureAtlas.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureAtlas.kt new file mode 100644 index 000000000..a3d5379d8 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureAtlas.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from packer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTextureAtlas( + uvMap: HashMap, + texture: KMTextureHolderInterface?, +) { + val uvMap: HashMap + val texture: KMTextureHolderInterface? +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureFilterType.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureFilterType.kt new file mode 100644 index 000000000..745560371 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureFilterType.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMTextureFilterType { + NEAREST, + LINEAR, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureHolderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureHolderInterface.kt new file mode 100644 index 000000000..442b56e4e --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureHolderInterface.kt @@ -0,0 +1,19 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMTextureHolderInterface { + + fun getImageWidth(): Int + + fun getImageHeight(): Int + + fun getTextureWidth(): Int + + fun getTextureHeight(): Int + + fun attachToGraphics(): Int + + fun clearFromGraphics() +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureLoaderResult.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureLoaderResult.kt new file mode 100644 index 000000000..3507977d2 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureLoaderResult.kt @@ -0,0 +1,16 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTextureLoaderResult( + data: KMTextureHolderInterface?, + etag: String?, + status: KMLoaderStatus, + errorCode: String?, +) { + val data: KMTextureHolderInterface? + val etag: String? + val status: KMLoaderStatus + val errorCode: String? +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMThreadPoolScheduler.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMThreadPoolScheduler.kt new file mode 100644 index 000000000..52e166542 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMThreadPoolScheduler.kt @@ -0,0 +1,13 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMThreadPoolScheduler constructor(nativeHandle: Any) { + + companion object + { + + fun create(): KMSchedulerInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapLayerConfig.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapLayerConfig.kt new file mode 100644 index 000000000..1d14b9d05 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapLayerConfig.kt @@ -0,0 +1,23 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMTiled2dMapLayerConfig { + + fun getCoordinateSystemIdentifier(): Int + + fun getTileUrl(x: Int, y: Int, t: Int, zoom: Int): String + + fun getZoomLevelInfos(): ArrayList + + fun getVirtualZoomLevelInfos(): ArrayList + + fun getZoomInfo(): KMTiled2dMapZoomInfo + + fun getLayerName(): String + + fun getVectorSettings(): KMTiled2dMapVectorSettings? + + fun getBounds(): KMRectCoord? +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerCallbackInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerCallbackInterface.kt new file mode 100644 index 000000000..59faab1f1 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerCallbackInterface.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_raster_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMTiled2dMapRasterLayerCallbackInterface { + + fun onClickConfirmed(coord: KMCoord): Boolean + + fun onLongPress(coord: KMCoord): Boolean +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerInterface.kt new file mode 100644 index 000000000..c2b13456b --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerInterface.kt @@ -0,0 +1,53 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_raster_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTiled2dMapRasterLayerInterface constructor(nativeHandle: Any) { + + fun asLayerInterface(): KMLayerInterface + + fun setCallbackHandler(handler: KMTiled2dMapRasterLayerCallbackInterface) + + fun getCallbackHandler(): KMTiled2dMapRasterLayerCallbackInterface? + + fun removeCallbackHandler() + + fun setAlpha(alpha: Float) + + fun getAlpha(): Float + + fun setStyle(style: KMRasterShaderStyle) + + fun getStyle(): KMRasterShaderStyle + + fun setMinMagFilter(filterType: KMTextureFilterType) + + fun setMinZoomLevelIdentifier(value: Int?) + + fun getMinZoomLevelIdentifier(): Int? + + fun setMaxZoomLevelIdentifier(value: Int?) + + fun getMaxZoomLevelIdentifier(): Int? + + fun setT(t: Int) + + fun setReadyStateListener(listener: KMTiled2dMapReadyStateListener?) + + fun getConfig(): KMTiled2dMapLayerConfig + + fun set3dSubdivisionFactor(factor: Int) + + fun setBlendMode(blendMode: KMBlendMode) + + companion object + { + + fun createWithMask(layerConfig: KMTiled2dMapLayerConfig, loaders: ArrayList, mask: KMMaskingObjectInterface): KMTiled2dMapRasterLayerInterface + + fun createWithShader(layerConfig: KMTiled2dMapLayerConfig, loaders: ArrayList, shader: KMShaderProgramInterface): KMTiled2dMapRasterLayerInterface + + fun create(layerConfig: KMTiled2dMapLayerConfig, loaders: ArrayList): KMTiled2dMapRasterLayerInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapReadyStateListener.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapReadyStateListener.kt new file mode 100644 index 000000000..6270c393c --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapReadyStateListener.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMTiled2dMapReadyStateListener { + + fun stateUpdate(state: KMLayerReadyState) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapSourceInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapSourceInterface.kt new file mode 100644 index 000000000..71b1f3259 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapSourceInterface.kt @@ -0,0 +1,31 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTiled2dMapSourceInterface constructor(nativeHandle: Any) { + + fun onVisibleBoundsChanged(visibleBounds: KMRectCoord, curT: Int, zoom: Double) + + fun onCameraChange(viewMatrix: ArrayList, projectionMatrix: ArrayList, origin: KMVec3D, verticalFov: Float, horizontalFov: Float, width: Float, height: Float, focusPointAltitude: Float, focusPointPosition: KMCoord, zoom: Float) + + fun setMinZoomLevelIdentifier(value: Int?) + + fun getMinZoomLevelIdentifier(): Int? + + fun setMaxZoomLevelIdentifier(value: Int?) + + fun getMaxZoomLevelIdentifier(): Int? + + fun pause() + + fun resume() + + fun isReadyToRenderOffscreen(): KMLayerReadyState + + fun setErrorManager(errorManager: KMErrorManager) + + fun forceReload() + + fun notifyTilesUpdates() +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorAssetInfo.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorAssetInfo.kt new file mode 100644 index 000000000..52f6e4fe4 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorAssetInfo.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTiled2dMapVectorAssetInfo( + featureIdentifiersUv: HashMap, + texture: KMTextureHolderInterface?, +) { + val featureIdentifiersUv: HashMap + val texture: KMTextureHolderInterface? +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerInterface.kt new file mode 100644 index 000000000..bd21222ff --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerInterface.kt @@ -0,0 +1,43 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTiled2dMapVectorLayerInterface constructor(nativeHandle: Any) { + + fun setSelectionDelegate(selectionDelegate: KMTiled2dMapVectorLayerSelectionCallbackInterface?) + + fun asLayerInterface(): KMLayerInterface + + fun setMinZoomLevelIdentifier(value: Int?) + + fun getMinZoomLevelIdentifier(): Int? + + fun setMaxZoomLevelIdentifier(value: Int?) + + fun getMaxZoomLevelIdentifier(): Int? + + fun getStyleMetadataJson(): String? + + fun setFeatureState(identifier: String, properties: HashMap) + + fun setGlobalState(properties: HashMap) + + fun getVisiblePointFeatureContexts(paddingPc: Float, sourceLayer: String?): ArrayList + + fun setReadyStateListener(listener: KMTiled2dMapReadyStateListener?) + + fun reloadDataSource(sourceName: String) + + fun reloadLocalDataSource(sourceName: String, geoJson: String) + + fun performClick(coord: KMCoord) + + companion object + { + + fun createFromStyleJson(layerName: String, styleJsonUrl: String, loaders: ArrayList, fontLoader: KMFontLoaderInterface): KMTiled2dMapVectorLayerInterface + + fun createExplicitly(layerName: String, styleJson: String?, localStyleJson: Boolean?, loaders: ArrayList, fontLoader: KMFontLoaderInterface, localDataProvider: KMTiled2dMapVectorLayerLocalDataProviderInterface?, customZoomInfo: KMTiled2dMapZoomInfo?, symbolDelegate: KMTiled2dMapVectorLayerSymbolDelegateInterface?, sourceUrlParams: HashMap?): KMTiled2dMapVectorLayerInterface + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerLocalDataProviderInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerLocalDataProviderInterface.kt new file mode 100644 index 000000000..6eb0054bf --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerLocalDataProviderInterface.kt @@ -0,0 +1,15 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMTiled2dMapVectorLayerLocalDataProviderInterface { + + fun getStyleJson(): String? + + fun loadSpriteAsync(spriteId: String, url: String, scale: Int): KMFuture + + fun loadSpriteJsonAsync(spriteId: String, url: String, scale: Int): KMFuture + + fun loadGeojson(sourceName: String, url: String): KMFuture +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSelectionCallbackInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSelectionCallbackInterface.kt new file mode 100644 index 000000000..19923d524 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSelectionCallbackInterface.kt @@ -0,0 +1,13 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMTiled2dMapVectorLayerSelectionCallbackInterface { + + fun didSelectFeature(featureInfo: KMVectorLayerFeatureInfo, layerIdentifier: String, coord: KMCoord): Boolean + + fun didMultiSelectLayerFeatures(featureInfos: ArrayList, layerIdentifier: String, coord: KMCoord): Boolean + + fun didClickBackgroundConfirmed(coord: KMCoord): Boolean +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSymbolDelegateInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSymbolDelegateInterface.kt new file mode 100644 index 000000000..b1940f147 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSymbolDelegateInterface.kt @@ -0,0 +1,9 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMTiled2dMapVectorLayerSymbolDelegateInterface { + + fun getCustomAssetsFor(featureInfos: ArrayList, layerIdentifier: String): ArrayList +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorSettings.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorSettings.kt new file mode 100644 index 000000000..901efd179 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorSettings.kt @@ -0,0 +1,10 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTiled2dMapVectorSettings( + tileOrigin: KMTiled2dMapVectorTileOrigin, +) { + val tileOrigin: KMTiled2dMapVectorTileOrigin +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorTileOrigin.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorTileOrigin.kt new file mode 100644 index 000000000..1e448e22a --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorTileOrigin.kt @@ -0,0 +1,11 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMTiled2dMapVectorTileOrigin { + TOP_LEFT, + BOTTOM_LEFT, + TOP_RIGHT, + BOTTOM_RIGHT, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomInfo.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomInfo.kt new file mode 100644 index 000000000..d00a6db92 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomInfo.kt @@ -0,0 +1,22 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTiled2dMapZoomInfo( + zoomLevelScaleFactor: Float, + numDrawPreviousLayers: Int, + numDrawPreviousOrLaterTLayers: Int, + adaptScaleToScreen: Boolean, + maskTile: Boolean, + underzoom: Boolean, + overzoom: Boolean, +) { + val zoomLevelScaleFactor: Float + val numDrawPreviousLayers: Int + val numDrawPreviousOrLaterTLayers: Int + val adaptScaleToScreen: Boolean + val maskTile: Boolean + val underzoom: Boolean + val overzoom: Boolean +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomLevelInfo.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomLevelInfo.kt new file mode 100644 index 000000000..685ce0037 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomLevelInfo.kt @@ -0,0 +1,22 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTiled2dMapZoomLevelInfo( + zoom: Double, + tileWidthLayerSystemUnits: Float, + numTilesX: Int, + numTilesY: Int, + numTilesT: Int, + zoomLevelIdentifier: Int, + bounds: KMRectCoord, +) { + val zoom: Double + val tileWidthLayerSystemUnits: Float + val numTilesX: Int + val numTilesY: Int + val numTilesT: Int + val zoomLevelIdentifier: Int + val bounds: KMRectCoord +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiledLayerError.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiledLayerError.kt new file mode 100644 index 000000000..5885f6e42 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiledLayerError.kt @@ -0,0 +1,20 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTiledLayerError( + status: KMLoaderStatus, + errorCode: String?, + layerName: String, + url: String, + isRecoverable: Boolean, + bounds: KMRectCoord?, +) { + val status: KMLoaderStatus + val errorCode: String? + val layerName: String + val url: String + val isRecoverable: Boolean + val bounds: KMRectCoord? +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchAction.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchAction.kt new file mode 100644 index 000000000..06381ea62 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchAction.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +package io.openmobilemaps.mapscore.kmp + +expect enum class KMTouchAction { + DOWN, + MOVE, + UP, + SCROLL, + CANCEL, +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchEvent.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchEvent.kt new file mode 100644 index 000000000..e860aef00 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchEvent.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMTouchEvent( + pointers: ArrayList, + scrollDelta: Float, + touchAction: KMTouchAction, +) { + val pointers: ArrayList + val scrollDelta: Float + val touchAction: KMTouchAction +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchHandlerInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchHandlerInterface.kt new file mode 100644 index 000000000..289b107fd --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchHandlerInterface.kt @@ -0,0 +1,15 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMTouchHandlerInterface { + + fun onTouchEvent(touchEvent: KMTouchEvent) + + fun insertListener(listener: KMTouchInterface, index: Int) + + fun addListener(listener: KMTouchInterface) + + fun removeListener(listener: KMTouchInterface) +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchInterface.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchInterface.kt new file mode 100644 index 000000000..4c2827696 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchInterface.kt @@ -0,0 +1,33 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +package io.openmobilemaps.mapscore.kmp + +expect interface KMTouchInterface { + + fun onTouchDown(posScreen: KMVec2F): Boolean + + fun onClickUnconfirmed(posScreen: KMVec2F): Boolean + + fun onClickConfirmed(posScreen: KMVec2F): Boolean + + fun onDoubleClick(posScreen: KMVec2F): Boolean + + fun onLongPress(posScreen: KMVec2F): Boolean + + fun onMove(deltaScreen: KMVec2F, confirmed: Boolean, doubleClick: Boolean): Boolean + + fun onMoveComplete(): Boolean + + fun onOneFingerDoubleClickMoveComplete(): Boolean + + fun onTwoFingerClick(posScreen1: KMVec2F, posScreen2: KMVec2F): Boolean + + fun onTwoFingerMove(posScreenOld: ArrayList, posScreenNew: ArrayList): Boolean + + fun onTwoFingerMoveComplete(): Boolean + + fun onScroll(posScreen: KMVec2F, scrollDelta: Float): Boolean + + fun clearTouch() +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2D.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2D.kt new file mode 100644 index 000000000..2581ee186 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2D.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMVec2D( + x: Double, + y: Double, +) { + val x: Double + val y: Double +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2F.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2F.kt new file mode 100644 index 000000000..3d116b29b --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2F.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMVec2F( + x: Float, + y: Float, +) { + val x: Float + val y: Float +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2I.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2I.kt new file mode 100644 index 000000000..62bf1c352 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2I.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMVec2I( + x: Int, + y: Int, +) { + val x: Int + val y: Int +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3D.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3D.kt new file mode 100644 index 000000000..b3059252b --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3D.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMVec3D( + x: Double, + y: Double, + z: Double, +) { + val x: Double + val y: Double + val z: Double +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3F.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3F.kt new file mode 100644 index 000000000..70a5cf4fc --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3F.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMVec3F( + x: Float, + y: Float, + z: Float, +) { + val x: Float + val y: Float + val z: Float +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3I.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3I.kt new file mode 100644 index 000000000..a26a6acc4 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3I.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMVec3I( + x: Int, + y: Int, + z: Int, +) { + val x: Int + val y: Int + val z: Int +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureCoordInfo.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureCoordInfo.kt new file mode 100644 index 000000000..88af0f6cb --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureCoordInfo.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMVectorLayerFeatureCoordInfo( + featureInfo: KMVectorLayerFeatureInfo, + coordinates: KMCoord, +) { + val featureInfo: KMVectorLayerFeatureInfo + val coordinates: KMCoord +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfo.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfo.kt new file mode 100644 index 000000000..748fd9179 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfo.kt @@ -0,0 +1,12 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMVectorLayerFeatureInfo( + identifier: String, + properties: HashMap, +) { + val identifier: String + val properties: HashMap +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfoValue.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfoValue.kt new file mode 100644 index 000000000..8a31473be --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfoValue.kt @@ -0,0 +1,22 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMVectorLayerFeatureInfoValue( + stringVal: String?, + doubleVal: Double?, + intVal: Long?, + boolVal: Boolean?, + colorVal: KMColor?, + listFloatVal: ArrayList?, + listStringVal: ArrayList?, +) { + val stringVal: String? + val doubleVal: Double? + val intVal: Long? + val boolVal: Boolean? + val colorVal: KMColor? + val listFloatVal: ArrayList? + val listStringVal: ArrayList? +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsCapabilitiesResource.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsCapabilitiesResource.kt new file mode 100644 index 000000000..5d5e5ffe3 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsCapabilitiesResource.kt @@ -0,0 +1,31 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMWmtsCapabilitiesResource constructor(nativeHandle: Any) { + + fun createLayer(identifier: String, tileLoaders: ArrayList): KMTiled2dMapRasterLayerInterface? + + fun createLayerTimed(identifier: String, tileLoaders: ArrayList, numT: Int): KMTiled2dMapRasterLayerInterface? + + fun createLayerWithZoomInfo(identifier: String, tileLoaders: ArrayList, zoomInfo: KMTiled2dMapZoomInfo): KMTiled2dMapRasterLayerInterface? + + fun createLayerWithZoomInfoTimed(identifier: String, tileLoaders: ArrayList, zoomInfo: KMTiled2dMapZoomInfo, numT: Int): KMTiled2dMapRasterLayerInterface? + + fun createLayerConfig(identifier: String): KMTiled2dMapLayerConfig? + + fun createLayerConfigTimed(identifier: String, numT: Int): KMTiled2dMapLayerConfig? + + fun createLayerConfigWithZoomInfo(identifier: String, zoomInfo: KMTiled2dMapZoomInfo): KMTiled2dMapLayerConfig? + + fun createLayerConfigWithZoomInfoTimed(identifier: String, zoomInfo: KMTiled2dMapZoomInfo, numT: Int): KMTiled2dMapLayerConfig? + + fun getAllLayers(): ArrayList + + companion object + { + + fun create(xml: String): KMWmtsCapabilitiesResource + } +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDescription.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDescription.kt new file mode 100644 index 000000000..d4c730812 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDescription.kt @@ -0,0 +1,24 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMWmtsLayerDescription( + identifier: String, + title: String?, + abstractText: String?, + dimensions: ArrayList, + bounds: KMRectCoord?, + tileMatrixSetLink: String, + resourceTemplate: String, + resourceFormat: String, +) { + val identifier: String + val title: String? + val abstractText: String? + val dimensions: ArrayList + val bounds: KMRectCoord? + val tileMatrixSetLink: String + val resourceTemplate: String + val resourceFormat: String +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDimension.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDimension.kt new file mode 100644 index 000000000..e221e8890 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDimension.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMWmtsLayerDimension( + identifier: String, + defaultValue: String, + values: ArrayList, +) { + val identifier: String + val defaultValue: String + val values: ArrayList +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrix.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrix.kt new file mode 100644 index 000000000..55d095181 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrix.kt @@ -0,0 +1,24 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMWmtsTileMatrix( + identifier: String, + scaleDenominator: Double, + topLeftCornerX: Double, + topLeftCornerY: Double, + tileWidth: Int, + tileHeight: Int, + matrixWidth: Int, + matrixHeight: Int, +) { + val identifier: String + val scaleDenominator: Double + val topLeftCornerX: Double + val topLeftCornerY: Double + val tileWidth: Int + val tileHeight: Int + val matrixWidth: Int + val matrixHeight: Int +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrixSet.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrixSet.kt new file mode 100644 index 000000000..19d9db0f3 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrixSet.kt @@ -0,0 +1,14 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMWmtsTileMatrixSet( + identifier: String, + coordinateSystemIdentifier: Int, + matrices: ArrayList, +) { + val identifier: String + val coordinateSystemIdentifier: Int + val matrices: ArrayList +} diff --git a/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTiled2dMapLayerConfigFactory.kt b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTiled2dMapLayerConfigFactory.kt new file mode 100644 index 000000000..bdfbf2876 --- /dev/null +++ b/bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTiled2dMapLayerConfigFactory.kt @@ -0,0 +1,13 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +package io.openmobilemaps.mapscore.kmp + +expect class KMWmtsTiled2dMapLayerConfigFactory constructor(nativeHandle: Any) { + + companion object + { + + fun create(wmtsLayerConfiguration: KMWmtsLayerDescription, zoomLevelInfo: ArrayList, zoomInfo: KMTiled2dMapZoomInfo, coordinateSystemIdentifier: Int, matrixSetIdentifier: String): KMTiled2dMapLayerConfig + } +} diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaInstancedShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaInstancedShaderInterface.kt new file mode 100644 index 000000000..855b47adc --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaInstancedShaderInterface.kt @@ -0,0 +1,26 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMAlphaInstancedShaderInterface", exact = true) +actual class KMAlphaInstancedShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCAlphaInstancedShaderInterfaceProtocol + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } +} + +internal fun KMAlphaInstancedShaderInterface.asPlatform(): MapCoreSharedModule.MCAlphaInstancedShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCAlphaInstancedShaderInterfaceProtocol +public fun MapCoreSharedModule.MCAlphaInstancedShaderInterfaceProtocol.asKmp(): KMAlphaInstancedShaderInterface = KMAlphaInstancedShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaShaderInterface.kt new file mode 100644 index 000000000..b45067faf --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAlphaShaderInterface.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMAlphaShaderInterface", exact = true) +actual class KMAlphaShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCAlphaShaderInterfaceProtocol + + actual fun updateAlpha(value: Float) { + native.updateAlpha(value) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } +} + +internal fun KMAlphaShaderInterface.asPlatform(): MapCoreSharedModule.MCAlphaShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCAlphaShaderInterfaceProtocol +public fun MapCoreSharedModule.MCAlphaShaderInterfaceProtocol.asKmp(): KMAlphaShaderInterface = KMAlphaShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAnchor.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAnchor.kt new file mode 100644 index 000000000..15cc31dcc --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMAnchor.kt @@ -0,0 +1,44 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMAnchor", exact = true) +actual enum class KMAnchor(val rawValue: Long) { + CENTER(0L), + LEFT(1L), + RIGHT(2L), + TOP(3L), + BOTTOM(4L), + TOP_LEFT(5L), + TOP_RIGHT(6L), + BOTTOM_LEFT(7L), + BOTTOM_RIGHT(8L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCAnchor): KMAnchor { + val raw: Long = value + return when (raw) { + 0L -> KMAnchor.CENTER + 1L -> KMAnchor.LEFT + 2L -> KMAnchor.RIGHT + 3L -> KMAnchor.TOP + 4L -> KMAnchor.BOTTOM + 5L -> KMAnchor.TOP_LEFT + 6L -> KMAnchor.TOP_RIGHT + 7L -> KMAnchor.BOTTOM_LEFT + 8L -> KMAnchor.BOTTOM_RIGHT + else -> throw IllegalArgumentException("Unknown KMAnchor value: " + raw) + } + } + } +} + +internal fun KMAnchor.asPlatform(): MapCoreSharedModule.MCAnchor = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBlendMode.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBlendMode.kt new file mode 100644 index 000000000..bc49d6b80 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBlendMode.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMBlendMode", exact = true) +actual enum class KMBlendMode(val rawValue: Long) { + NORMAL(0L), + MULTIPLY(1L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCBlendMode): KMBlendMode { + val raw: Long = value + return when (raw) { + 0L -> KMBlendMode.NORMAL + 1L -> KMBlendMode.MULTIPLY + else -> throw IllegalArgumentException("Unknown KMBlendMode value: " + raw) + } + } + } +} + +internal fun KMBlendMode.asPlatform(): MapCoreSharedModule.MCBlendMode = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBoundingBoxInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBoundingBoxInterface.kt new file mode 100644 index 000000000..25d6a9d86 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMBoundingBoxInterface.kt @@ -0,0 +1,59 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMBoundingBoxInterface", exact = true) +actual class KMBoundingBoxInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCBoundingBoxInterface + + actual fun addPoint(p: KMCoord) { + native.addPoint(p.asPlatform()) + } + + actual fun asRectCoord(): KMRectCoord { + val result = native.asRectCoord() + return (result as MapCoreSharedModule.MCRectCoord).asKmp() + } + + actual fun getCenter(): KMCoord { + val result = native.getCenter() + return (result as MapCoreSharedModule.MCCoord).asKmp() + } + + actual fun getMin(): KMCoord { + val result = native.getMin() + return (result as MapCoreSharedModule.MCCoord).asKmp() + } + + actual fun getMax(): KMCoord { + val result = native.getMax() + return (result as MapCoreSharedModule.MCCoord).asKmp() + } + + actual fun getSystemIdentifier(): Int { + val result = native.getSystemIdentifier() + return result + } + + actual companion object + { + + actual fun create(systemIdentifier: Int): KMBoundingBoxInterface { + val result = MapCoreSharedModule.MCBoundingBoxInterface.create(systemIdentifier) + return (result as MapCoreSharedModule.MCBoundingBoxInterface).asKmp() + } + } +} + +internal fun KMBoundingBoxInterface.asPlatform(): MapCoreSharedModule.MCBoundingBoxInterface = nativeHandle as MapCoreSharedModule.MCBoundingBoxInterface +public fun MapCoreSharedModule.MCBoundingBoxInterface.asKmp(): KMBoundingBoxInterface = KMBoundingBoxInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfig.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfig.kt new file mode 100644 index 000000000..eb6c1ede9 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfig.kt @@ -0,0 +1,52 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCamera3dConfig", exact = true) +actual class KMCamera3dConfig actual public constructor( + key: String, + allowUserInteraction: Boolean, + rotationSpeed: Float?, + animationDurationMs: Int, + minZoom: Float, + maxZoom: Float, + pitchInterpolationValues: KMCameraInterpolation, + verticalDisplacementInterpolationValues: KMCameraInterpolation, +) { + actual val key: String = key + actual val allowUserInteraction: Boolean = allowUserInteraction + actual val rotationSpeed: Float? = rotationSpeed + actual val animationDurationMs: Int = animationDurationMs + actual val minZoom: Float = minZoom + actual val maxZoom: Float = maxZoom + actual val pitchInterpolationValues: KMCameraInterpolation = pitchInterpolationValues + actual val verticalDisplacementInterpolationValues: KMCameraInterpolation = verticalDisplacementInterpolationValues +} + +internal fun KMCamera3dConfig.asPlatform(): MapCoreSharedModule.MCCamera3dConfig = MapCoreSharedModule.MCCamera3dConfig( + key = key, + allowUserInteraction = allowUserInteraction, + rotationSpeed = rotationSpeed?.let { platform.Foundation.NSNumber(float = it) }, + animationDurationMs = animationDurationMs, + minZoom = minZoom, + maxZoom = maxZoom, + pitchInterpolationValues = pitchInterpolationValues.asPlatform(), + verticalDisplacementInterpolationValues = verticalDisplacementInterpolationValues.asPlatform(), +) +public fun MapCoreSharedModule.MCCamera3dConfig.asKmp(): KMCamera3dConfig = KMCamera3dConfig( + key = this.key, + allowUserInteraction = this.allowUserInteraction, + rotationSpeed = this.rotationSpeed?.let { (it as platform.Foundation.NSNumber).floatValue }, + animationDurationMs = this.animationDurationMs, + minZoom = this.minZoom, + maxZoom = this.maxZoom, + pitchInterpolationValues = (this.pitchInterpolationValues as MapCoreSharedModule.MCCameraInterpolation).asKmp(), + verticalDisplacementInterpolationValues = (this.verticalDisplacementInterpolationValues as MapCoreSharedModule.MCCameraInterpolation).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfigFactory.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfigFactory.kt new file mode 100644 index 000000000..173a7ca60 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCamera3dConfigFactory.kt @@ -0,0 +1,35 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCamera3dConfigFactory", exact = true) +actual class KMCamera3dConfigFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCCamera3dConfigFactory + + actual companion object + { + + actual fun getBasicConfig(): KMCamera3dConfig { + val result = MapCoreSharedModule.MCCamera3dConfigFactory.getBasicConfig() + return (result as MapCoreSharedModule.MCCamera3dConfig).asKmp() + } + + actual fun getRestorConfig(): KMCamera3dConfig { + val result = MapCoreSharedModule.MCCamera3dConfigFactory.getRestorConfig() + return (result as MapCoreSharedModule.MCCamera3dConfig).asKmp() + } + } +} + +internal fun KMCamera3dConfigFactory.asPlatform(): MapCoreSharedModule.MCCamera3dConfigFactory = nativeHandle as MapCoreSharedModule.MCCamera3dConfigFactory +public fun MapCoreSharedModule.MCCamera3dConfigFactory.asKmp(): KMCamera3dConfigFactory = KMCamera3dConfigFactory(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterface.kt new file mode 100644 index 000000000..a0c28b027 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterface.kt @@ -0,0 +1,76 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCameraInterface", exact = true) +actual interface KMCameraInterface +{ + + actual fun getVpMatrix(): ArrayList + + actual fun getScalingFactor(): Double + + actual fun getOrigin(): KMVec3D + + actual fun viewportSizeChanged() +} + +private class KMCameraInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCCameraInterfaceProtocol) : KMCameraInterface +{ + + override fun getVpMatrix(): ArrayList { + val result = nativeHandle.getVpMatrix() + return ArrayList(((result as? List<*>)?.map { (it as platform.Foundation.NSNumber).floatValue } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as platform.Foundation.NSNumber).floatValue })) + } + + override fun getScalingFactor(): Double { + val result = nativeHandle.getScalingFactor() + return result + } + + override fun getOrigin(): KMVec3D { + val result = nativeHandle.getOrigin() + return (result as MapCoreSharedModule.MCVec3D).asKmp() + } + + override fun viewportSizeChanged() { + nativeHandle.viewportSizeChanged() + } +} + +private class KMCameraInterfacePlatformProxy(private val delegate: KMCameraInterface) : NSObject(), MapCoreSharedModule.MCCameraInterfaceProtocol +{ + + override fun getVpMatrix(): List<*> { + val result = delegate.getVpMatrix() + return ArrayList(result.map { platform.Foundation.NSNumber(float = it) }) + } + + override fun getScalingFactor(): Double { + val result = delegate.getScalingFactor() + return result + } + + override fun getOrigin(): MapCoreSharedModule.MCVec3D { + val result = delegate.getOrigin() + return result.asPlatform() + } + + override fun viewportSizeChanged() { + delegate.viewportSizeChanged() + } +} + +internal fun KMCameraInterface.asPlatform(): MapCoreSharedModule.MCCameraInterfaceProtocol = when (this) { + is KMCameraInterfacePlatformWrapper -> this.nativeHandle + else -> KMCameraInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCCameraInterfaceProtocol.asKmp(): KMCameraInterface = KMCameraInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolation.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolation.kt new file mode 100644 index 000000000..58168eadf --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolation.kt @@ -0,0 +1,24 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCameraInterpolation", exact = true) +actual class KMCameraInterpolation actual public constructor( + stops: ArrayList, +) { + actual val stops: ArrayList = stops +} + +internal fun KMCameraInterpolation.asPlatform(): MapCoreSharedModule.MCCameraInterpolation = MapCoreSharedModule.MCCameraInterpolation( + stops = ArrayList(stops.map { it.asPlatform() }), +) +public fun MapCoreSharedModule.MCCameraInterpolation.asKmp(): KMCameraInterpolation = KMCameraInterpolation( + stops = ArrayList(((this.stops as? List<*>)?.map { (it as MapCoreSharedModule.MCCameraInterpolationValue).asKmp() } ?: (0 until (this.stops as platform.Foundation.NSArray).count.toInt()).map { idx -> ((this.stops as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCCameraInterpolationValue).asKmp() })), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolationValue.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolationValue.kt new file mode 100644 index 000000000..2b97b8adf --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCameraInterpolationValue.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCameraInterpolationValue", exact = true) +actual class KMCameraInterpolationValue actual public constructor( + stop: Float, + value: Float, +) { + actual val stop: Float = stop + actual val value: Float = value +} + +internal fun KMCameraInterpolationValue.asPlatform(): MapCoreSharedModule.MCCameraInterpolationValue = MapCoreSharedModule.MCCameraInterpolationValue( + stop = stop, + value = value, +) +public fun MapCoreSharedModule.MCCameraInterpolationValue.asKmp(): KMCameraInterpolationValue = KMCameraInterpolationValue( + stop = this.stop, + value = this.value, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleD.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleD.kt new file mode 100644 index 000000000..30851c423 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleD.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCircleD", exact = true) +actual class KMCircleD actual public constructor( + x: Double, + y: Double, + radius: Double, +) { + actual val x: Double = x + actual val y: Double = y + actual val radius: Double = radius +} + +internal fun KMCircleD.asPlatform(): MapCoreSharedModule.MCCircleD = MapCoreSharedModule.MCCircleD( + x = x, + y = y, + radius = radius, +) +public fun MapCoreSharedModule.MCCircleD.asKmp(): KMCircleD = KMCircleD( + x = this.x, + y = this.y, + radius = this.radius, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleF.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleF.kt new file mode 100644 index 000000000..4058c82f0 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleF.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCircleF", exact = true) +actual class KMCircleF actual public constructor( + x: Float, + y: Float, + radius: Float, +) { + actual val x: Float = x + actual val y: Float = y + actual val radius: Float = radius +} + +internal fun KMCircleF.asPlatform(): MapCoreSharedModule.MCCircleF = MapCoreSharedModule.MCCircleF( + x = x, + y = y, + radius = radius, +) +public fun MapCoreSharedModule.MCCircleF.asKmp(): KMCircleF = KMCircleF( + x = this.x, + y = this.y, + radius = this.radius, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleI.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleI.kt new file mode 100644 index 000000000..76968952d --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCircleI.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCircleI", exact = true) +actual class KMCircleI actual public constructor( + x: Int, + y: Int, + radius: Int, +) { + actual val x: Int = x + actual val y: Int = y + actual val radius: Int = radius +} + +internal fun KMCircleI.asPlatform(): MapCoreSharedModule.MCCircleI = MapCoreSharedModule.MCCircleI( + x = x, + y = y, + radius = radius, +) +public fun MapCoreSharedModule.MCCircleI.asKmp(): KMCircleI = KMCircleI( + x = this.x, + y = this.y, + radius = this.radius, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColor.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColor.kt new file mode 100644 index 000000000..7f2d7ca78 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColor.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMColor", exact = true) +actual class KMColor actual public constructor( + r: Float, + g: Float, + b: Float, + a: Float, +) { + actual val r: Float = r + actual val g: Float = g + actual val b: Float = b + actual val a: Float = a +} + +internal fun KMColor.asPlatform(): MapCoreSharedModule.MCColor = MapCoreSharedModule.MCColor( + r = r, + g = g, + b = b, + a = a, +) +public fun MapCoreSharedModule.MCColor.asKmp(): KMColor = KMColor( + r = this.r, + g = this.g, + b = this.b, + a = this.a, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorCircleShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorCircleShaderInterface.kt new file mode 100644 index 000000000..9441b761c --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorCircleShaderInterface.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMColorCircleShaderInterface", exact = true) +actual class KMColorCircleShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCColorCircleShaderInterfaceProtocol + + actual fun setColor(red: Float, green: Float, blue: Float, alpha: Float) { + native.setColor(red, green, blue, alpha) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } +} + +internal fun KMColorCircleShaderInterface.asPlatform(): MapCoreSharedModule.MCColorCircleShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCColorCircleShaderInterfaceProtocol +public fun MapCoreSharedModule.MCColorCircleShaderInterfaceProtocol.asKmp(): KMColorCircleShaderInterface = KMColorCircleShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorShaderInterface.kt new file mode 100644 index 000000000..998668713 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorShaderInterface.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMColorShaderInterface", exact = true) +actual class KMColorShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCColorShaderInterfaceProtocol + + actual fun setColor(red: Float, green: Float, blue: Float, alpha: Float) { + native.setColor(red, green, blue, alpha) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } +} + +internal fun KMColorShaderInterface.asPlatform(): MapCoreSharedModule.MCColorShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCColorShaderInterfaceProtocol +public fun MapCoreSharedModule.MCColorShaderInterfaceProtocol.asKmp(): KMColorShaderInterface = KMColorShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorStateList.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorStateList.kt new file mode 100644 index 000000000..8a1a398ce --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMColorStateList.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from styling.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMColorStateList", exact = true) +actual class KMColorStateList actual public constructor( + normal: KMColor, + highlighted: KMColor, +) { + actual val normal: KMColor = normal + actual val highlighted: KMColor = highlighted +} + +internal fun KMColorStateList.asPlatform(): MapCoreSharedModule.MCColorStateList = MapCoreSharedModule.MCColorStateList( + normal = normal.asPlatform(), + highlighted = highlighted.asPlatform(), +) +public fun MapCoreSharedModule.MCColorStateList.asKmp(): KMColorStateList = KMColorStateList( + normal = (this.normal as MapCoreSharedModule.MCColor).asKmp(), + highlighted = (this.highlighted as MapCoreSharedModule.MCColor).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputeObjectInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputeObjectInterface.kt new file mode 100644 index 000000000..0fb5e5178 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputeObjectInterface.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMComputeObjectInterface", exact = true) +actual interface KMComputeObjectInterface +{ + + actual fun compute(context: KMRenderingContextInterface, vpMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double) +} + +private class KMComputeObjectInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCComputeObjectInterfaceProtocol) : KMComputeObjectInterface +{ + + override fun compute(context: KMRenderingContextInterface, vpMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double) { + nativeHandle.compute(context.asPlatform(), vpMatrix, origin.asPlatform(), screenPixelAsRealMeterFactor) + } +} + +private class KMComputeObjectInterfacePlatformProxy(private val delegate: KMComputeObjectInterface) : NSObject(), MapCoreSharedModule.MCComputeObjectInterfaceProtocol +{ + + override fun compute(context: MapCoreSharedModule.MCRenderingContextInterfaceProtocol?, vpMatrix: Long, origin: MapCoreSharedModule.MCVec3D, screenPixelAsRealMeterFactor: Double) { + delegate.compute((context as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp(), vpMatrix, (origin as MapCoreSharedModule.MCVec3D).asKmp(), screenPixelAsRealMeterFactor) + } +} + +internal fun KMComputeObjectInterface.asPlatform(): MapCoreSharedModule.MCComputeObjectInterfaceProtocol = when (this) { + is KMComputeObjectInterfacePlatformWrapper -> this.nativeHandle + else -> KMComputeObjectInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCComputeObjectInterfaceProtocol.asKmp(): KMComputeObjectInterface = KMComputeObjectInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputePassInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputePassInterface.kt new file mode 100644 index 000000000..d5793cb91 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMComputePassInterface.kt @@ -0,0 +1,42 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMComputePassInterface", exact = true) +actual interface KMComputePassInterface +{ + + actual fun getComputeObjects(): ArrayList +} + +private class KMComputePassInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCComputePassInterfaceProtocol) : KMComputePassInterface +{ + + override fun getComputeObjects(): ArrayList { + val result = nativeHandle.getComputeObjects() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCComputeObjectInterfaceProtocol).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCComputeObjectInterfaceProtocol).asKmp() })) + } +} + +private class KMComputePassInterfacePlatformProxy(private val delegate: KMComputePassInterface) : NSObject(), MapCoreSharedModule.MCComputePassInterfaceProtocol +{ + + override fun getComputeObjects(): List<*> { + val result = delegate.getComputeObjects() + return ArrayList(result.map { it.asPlatform() }) + } +} + +internal fun KMComputePassInterface.asPlatform(): MapCoreSharedModule.MCComputePassInterfaceProtocol = when (this) { + is KMComputePassInterfacePlatformWrapper -> this.nativeHandle + else -> KMComputePassInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCComputePassInterfaceProtocol.asKmp(): KMComputePassInterface = KMComputePassInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoord.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoord.kt new file mode 100644 index 000000000..e02706839 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoord.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCoord", exact = true) +actual class KMCoord actual public constructor( + systemIdentifier: Int, + x: Double, + y: Double, + z: Double, +) { + actual val systemIdentifier: Int = systemIdentifier + actual val x: Double = x + actual val y: Double = y + actual val z: Double = z +} + +internal fun KMCoord.asPlatform(): MapCoreSharedModule.MCCoord = MapCoreSharedModule.MCCoord( + systemIdentifier = systemIdentifier, + x = x, + y = y, + z = z, +) +public fun MapCoreSharedModule.MCCoord.asKmp(): KMCoord = KMCoord( + systemIdentifier = this.systemIdentifier, + x = this.x, + y = this.y, + z = this.z, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConversionHelperInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConversionHelperInterface.kt new file mode 100644 index 000000000..bad626b18 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConversionHelperInterface.kt @@ -0,0 +1,64 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCoordinateConversionHelperInterface", exact = true) +actual class KMCoordinateConversionHelperInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCCoordinateConversionHelperInterface + + actual fun registerConverter(converter: KMCoordinateConverterInterface) { + native.registerConverter(converter.asPlatform()) + } + + actual fun convert(to: Int, coordinate: KMCoord): KMCoord { + val result = native.convert(to, coordinate.asPlatform()) + return (result as MapCoreSharedModule.MCCoord).asKmp() + } + + actual fun convertRect(to: Int, rect: KMRectCoord): KMRectCoord { + val result = native.convertRect(to, rect.asPlatform()) + return (result as MapCoreSharedModule.MCRectCoord).asKmp() + } + + actual fun convertRectToRenderSystem(rect: KMRectCoord): KMRectCoord { + val result = native.convertRectToRenderSystem(rect.asPlatform()) + return (result as MapCoreSharedModule.MCRectCoord).asKmp() + } + + actual fun convertQuad(to: Int, quad: KMQuadCoord): KMQuadCoord { + val result = native.convertQuad(to, quad.asPlatform()) + return (result as MapCoreSharedModule.MCQuadCoord).asKmp() + } + + actual fun convertQuadToRenderSystem(quad: KMQuadCoord): KMQuadCoord { + val result = native.convertQuadToRenderSystem(quad.asPlatform()) + return (result as MapCoreSharedModule.MCQuadCoord).asKmp() + } + + actual fun convertToRenderSystem(coordinate: KMCoord): KMCoord { + val result = native.convertToRenderSystem(coordinate.asPlatform()) + return (result as MapCoreSharedModule.MCCoord).asKmp() + } + + actual companion object + { + + actual fun independentInstance(): KMCoordinateConversionHelperInterface { + val result = MapCoreSharedModule.MCCoordinateConversionHelperInterface.independentInstance() + return (result as MapCoreSharedModule.MCCoordinateConversionHelperInterface).asKmp() + } + } +} + +internal fun KMCoordinateConversionHelperInterface.asPlatform(): MapCoreSharedModule.MCCoordinateConversionHelperInterface = nativeHandle as MapCoreSharedModule.MCCoordinateConversionHelperInterface +public fun MapCoreSharedModule.MCCoordinateConversionHelperInterface.asKmp(): KMCoordinateConversionHelperInterface = KMCoordinateConversionHelperInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConverterInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConverterInterface.kt new file mode 100644 index 000000000..d12e36519 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateConverterInterface.kt @@ -0,0 +1,66 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCoordinateConverterInterface", exact = true) +actual interface KMCoordinateConverterInterface +{ + + actual fun convert(coordinate: KMCoord): KMCoord + + actual fun getFrom(): Int + + actual fun getTo(): Int +} + +private class KMCoordinateConverterInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCCoordinateConverterInterfaceProtocol) : KMCoordinateConverterInterface +{ + + override fun convert(coordinate: KMCoord): KMCoord { + val result = nativeHandle.convert(coordinate.asPlatform()) + return (result as MapCoreSharedModule.MCCoord).asKmp() + } + + override fun getFrom(): Int { + val result = nativeHandle.getFrom() + return result + } + + override fun getTo(): Int { + val result = nativeHandle.getTo() + return result + } +} + +private class KMCoordinateConverterInterfacePlatformProxy(private val delegate: KMCoordinateConverterInterface) : NSObject(), MapCoreSharedModule.MCCoordinateConverterInterfaceProtocol +{ + + override fun convert(coordinate: MapCoreSharedModule.MCCoord): MapCoreSharedModule.MCCoord { + val result = delegate.convert((coordinate as MapCoreSharedModule.MCCoord).asKmp()) + return result.asPlatform() + } + + override fun getFrom(): Int { + val result = delegate.getFrom() + return result + } + + override fun getTo(): Int { + val result = delegate.getTo() + return result + } +} + +internal fun KMCoordinateConverterInterface.asPlatform(): MapCoreSharedModule.MCCoordinateConverterInterfaceProtocol = when (this) { + is KMCoordinateConverterInterfacePlatformWrapper -> this.nativeHandle + else -> KMCoordinateConverterInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCCoordinateConverterInterfaceProtocol.asKmp(): KMCoordinateConverterInterface = KMCoordinateConverterInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemFactory.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemFactory.kt new file mode 100644 index 000000000..3561b0720 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemFactory.kt @@ -0,0 +1,50 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCoordinateSystemFactory", exact = true) +actual class KMCoordinateSystemFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCCoordinateSystemFactory + + actual companion object + { + + actual fun getEpsg2056System(): KMMapCoordinateSystem { + val result = MapCoreSharedModule.MCCoordinateSystemFactory.getEpsg2056System() + return (result as MapCoreSharedModule.MCMapCoordinateSystem).asKmp() + } + + actual fun getEpsg3857System(): KMMapCoordinateSystem { + val result = MapCoreSharedModule.MCCoordinateSystemFactory.getEpsg3857System() + return (result as MapCoreSharedModule.MCMapCoordinateSystem).asKmp() + } + + actual fun getEpsg4326System(): KMMapCoordinateSystem { + val result = MapCoreSharedModule.MCCoordinateSystemFactory.getEpsg4326System() + return (result as MapCoreSharedModule.MCMapCoordinateSystem).asKmp() + } + + actual fun getEpsg21781System(): KMMapCoordinateSystem { + val result = MapCoreSharedModule.MCCoordinateSystemFactory.getEpsg21781System() + return (result as MapCoreSharedModule.MCMapCoordinateSystem).asKmp() + } + + actual fun getUnitSphereSystem(): KMMapCoordinateSystem { + val result = MapCoreSharedModule.MCCoordinateSystemFactory.getUnitSphereSystem() + return (result as MapCoreSharedModule.MCMapCoordinateSystem).asKmp() + } + } +} + +internal fun KMCoordinateSystemFactory.asPlatform(): MapCoreSharedModule.MCCoordinateSystemFactory = nativeHandle as MapCoreSharedModule.MCCoordinateSystemFactory +public fun MapCoreSharedModule.MCCoordinateSystemFactory.asKmp(): KMCoordinateSystemFactory = KMCoordinateSystemFactory(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemIdentifiers.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemIdentifiers.kt new file mode 100644 index 000000000..96422cdaf --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCoordinateSystemIdentifiers.kt @@ -0,0 +1,65 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCoordinateSystemIdentifiers", exact = true) +actual class KMCoordinateSystemIdentifiers actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCCoordinateSystemIdentifiers + + actual companion object + { + + actual fun RENDERSYSTEM(): Int { + val result = MapCoreSharedModule.MCCoordinateSystemIdentifiers.RENDERSYSTEM() + return result + } + + actual fun EPSG3857(): Int { + val result = MapCoreSharedModule.MCCoordinateSystemIdentifiers.EPSG3857() + return result + } + + actual fun EPSG4326(): Int { + val result = MapCoreSharedModule.MCCoordinateSystemIdentifiers.EPSG4326() + return result + } + + actual fun EPSG2056(): Int { + val result = MapCoreSharedModule.MCCoordinateSystemIdentifiers.EPSG2056() + return result + } + + actual fun EPSG21781(): Int { + val result = MapCoreSharedModule.MCCoordinateSystemIdentifiers.EPSG21781() + return result + } + + actual fun UnitSphere(): Int { + val result = MapCoreSharedModule.MCCoordinateSystemIdentifiers.UnitSphere() + return result + } + + actual fun fromCrsIdentifier(identifier: String): Int { + val result = MapCoreSharedModule.MCCoordinateSystemIdentifiers.fromCrsIdentifier(identifier) + return result + } + + actual fun unitToMeterFactor(coordinateSystemIdentifier: Int): Double { + val result = MapCoreSharedModule.MCCoordinateSystemIdentifiers.unitToMeterFactor(coordinateSystemIdentifier) + return result + } + } +} + +internal fun KMCoordinateSystemIdentifiers.asPlatform(): MapCoreSharedModule.MCCoordinateSystemIdentifiers = nativeHandle as MapCoreSharedModule.MCCoordinateSystemIdentifiers +public fun MapCoreSharedModule.MCCoordinateSystemIdentifiers.asKmp(): KMCoordinateSystemIdentifiers = KMCoordinateSystemIdentifiers(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCpuPerformanceLoggerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCpuPerformanceLoggerInterface.kt new file mode 100644 index 000000000..fc99700a1 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMCpuPerformanceLoggerInterface.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMCpuPerformanceLoggerInterface", exact = true) +actual class KMCpuPerformanceLoggerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCCpuPerformanceLoggerInterface + + actual fun asPerformanceLoggerInterface(): KMPerformanceLoggerInterface { + val result = native.asPerformanceLoggerInterface() + return (result as MapCoreSharedModule.MCPerformanceLoggerInterfaceProtocol).asKmp() + } + + actual companion object + { + + actual fun create(): KMCpuPerformanceLoggerInterface { + val result = MapCoreSharedModule.MCCpuPerformanceLoggerInterface.create() + return (result as MapCoreSharedModule.MCCpuPerformanceLoggerInterface).asKmp() + } + + actual fun createSpecifically(numBuckets: Int, bucketSizeMs: Long): KMCpuPerformanceLoggerInterface { + val result = MapCoreSharedModule.MCCpuPerformanceLoggerInterface.createSpecifically(numBuckets, bucketSizeMs) + return (result as MapCoreSharedModule.MCCpuPerformanceLoggerInterface).asKmp() + } + } +} + +internal fun KMCpuPerformanceLoggerInterface.asPlatform(): MapCoreSharedModule.MCCpuPerformanceLoggerInterface = nativeHandle as MapCoreSharedModule.MCCpuPerformanceLoggerInterface +public fun MapCoreSharedModule.MCCpuPerformanceLoggerInterface.asKmp(): KMCpuPerformanceLoggerInterface = KMCpuPerformanceLoggerInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataLoaderResult.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataLoaderResult.kt new file mode 100644 index 000000000..26544fab3 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataLoaderResult.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMDataLoaderResult", exact = true) +actual class KMDataLoaderResult actual public constructor( + data: KMDataRef?, + etag: String?, + status: KMLoaderStatus, + errorCode: String?, +) { + actual val data: KMDataRef? = data + actual val etag: String? = etag + actual val status: KMLoaderStatus = status + actual val errorCode: String? = errorCode +} + +internal fun KMDataLoaderResult.asPlatform(): MapCoreSharedModule.MCDataLoaderResult = MapCoreSharedModule.MCDataLoaderResult( + data = data?.let { it.asPlatform() }, + etag = etag?.let { it }, + status = status.asPlatform(), + errorCode = errorCode?.let { it }, +) +public fun MapCoreSharedModule.MCDataLoaderResult.asKmp(): KMDataLoaderResult = KMDataLoaderResult( + data = this.data?.let { (it as platform.Foundation.NSData).asKmp() }, + etag = this.etag?.let { (it as String) }, + status = KMLoaderStatus.fromPlatform((this.status as MapCoreSharedModule.MCLoaderStatus)), + errorCode = this.errorCode?.let { (it as String) }, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTiled2dMapLayerConfigs.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTiled2dMapLayerConfigs.kt new file mode 100644 index 000000000..11c0cdd7a --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTiled2dMapLayerConfigs.kt @@ -0,0 +1,45 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMDefaultTiled2dMapLayerConfigs", exact = true) +actual class KMDefaultTiled2dMapLayerConfigs actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCDefaultTiled2dMapLayerConfigs + + actual companion object + { + + actual fun webMercator(layerName: String, urlFormat: String): KMTiled2dMapLayerConfig { + val result = MapCoreSharedModule.MCDefaultTiled2dMapLayerConfigs.webMercator(layerName, urlFormat) + return (result as MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol).asKmp() + } + + actual fun webMercatorCustom(layerName: String, urlFormat: String, zoomInfo: KMTiled2dMapZoomInfo?, minZoomLevel: Int, maxZoomLevel: Int): KMTiled2dMapLayerConfig { + val result = MapCoreSharedModule.MCDefaultTiled2dMapLayerConfigs.webMercatorCustom(layerName, urlFormat, zoomInfo?.let { it.asPlatform() }, minZoomLevel, maxZoomLevel) + return (result as MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol).asKmp() + } + + actual fun epsg4326(layerName: String, urlFormat: String): KMTiled2dMapLayerConfig { + val result = MapCoreSharedModule.MCDefaultTiled2dMapLayerConfigs.epsg4326(layerName, urlFormat) + return (result as MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol).asKmp() + } + + actual fun epsg4326Custom(layerName: String, urlFormat: String, zoomInfo: KMTiled2dMapZoomInfo, minZoomLevel: Int, maxZoomLevel: Int): KMTiled2dMapLayerConfig { + val result = MapCoreSharedModule.MCDefaultTiled2dMapLayerConfigs.epsg4326Custom(layerName, urlFormat, zoomInfo.asPlatform(), minZoomLevel, maxZoomLevel) + return (result as MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol).asKmp() + } + } +} + +internal fun KMDefaultTiled2dMapLayerConfigs.asPlatform(): MapCoreSharedModule.MCDefaultTiled2dMapLayerConfigs = nativeHandle as MapCoreSharedModule.MCDefaultTiled2dMapLayerConfigs +public fun MapCoreSharedModule.MCDefaultTiled2dMapLayerConfigs.asKmp(): KMDefaultTiled2dMapLayerConfigs = KMDefaultTiled2dMapLayerConfigs(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTouchHandlerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTouchHandlerInterface.kt new file mode 100644 index 000000000..970d3a232 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDefaultTouchHandlerInterface.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMDefaultTouchHandlerInterface", exact = true) +actual class KMDefaultTouchHandlerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCDefaultTouchHandlerInterface + + actual companion object + { + + actual fun create(scheduler: KMSchedulerInterface, density: Float): KMTouchHandlerInterface { + val result = MapCoreSharedModule.MCDefaultTouchHandlerInterface.create(scheduler.asPlatform(), density) + return (result as MapCoreSharedModule.MCTouchHandlerInterfaceProtocol).asKmp() + } + } +} + +internal fun KMDefaultTouchHandlerInterface.asPlatform(): MapCoreSharedModule.MCDefaultTouchHandlerInterface = nativeHandle as MapCoreSharedModule.MCDefaultTouchHandlerInterface +public fun MapCoreSharedModule.MCDefaultTouchHandlerInterface.asKmp(): KMDefaultTouchHandlerInterface = KMDefaultTouchHandlerInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMElevationInterpolationShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMElevationInterpolationShaderInterface.kt new file mode 100644 index 000000000..ca829d801 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMElevationInterpolationShaderInterface.kt @@ -0,0 +1,26 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMElevationInterpolationShaderInterface", exact = true) +actual class KMElevationInterpolationShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCElevationInterpolationShaderInterfaceProtocol + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } +} + +internal fun KMElevationInterpolationShaderInterface.asPlatform(): MapCoreSharedModule.MCElevationInterpolationShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCElevationInterpolationShaderInterfaceProtocol +public fun MapCoreSharedModule.MCElevationInterpolationShaderInterfaceProtocol.asKmp(): KMElevationInterpolationShaderInterface = KMElevationInterpolationShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManager.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManager.kt new file mode 100644 index 000000000..1e0e9e6c1 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManager.kt @@ -0,0 +1,54 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMErrorManager", exact = true) +actual class KMErrorManager actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCErrorManager + + actual fun addTiledLayerError(error: KMTiledLayerError) { + native.addTiledLayerError(error.asPlatform()) + } + + actual fun removeError(url: String) { + native.removeError(url) + } + + actual fun removeAllErrorsForLayer(layerName: String) { + native.removeAllErrorsForLayer(layerName) + } + + actual fun clearAllErrors() { + native.clearAllErrors() + } + + actual fun addErrorListener(listener: KMErrorManagerListener) { + native.addErrorListener(listener.asPlatform()) + } + + actual fun removeErrorListener(listener: KMErrorManagerListener) { + native.removeErrorListener(listener.asPlatform()) + } + + actual companion object + { + + actual fun create(): KMErrorManager { + val result = MapCoreSharedModule.MCErrorManager.create() + return (result as MapCoreSharedModule.MCErrorManager).asKmp() + } + } +} + +internal fun KMErrorManager.asPlatform(): MapCoreSharedModule.MCErrorManager = nativeHandle as MapCoreSharedModule.MCErrorManager +public fun MapCoreSharedModule.MCErrorManager.asKmp(): KMErrorManager = KMErrorManager(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManagerListener.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManagerListener.kt new file mode 100644 index 000000000..47a4d863b --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMErrorManagerListener.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMErrorManagerListener", exact = true) +actual interface KMErrorManagerListener +{ + + actual fun onTiledLayerErrorStateChanged(errors: ArrayList) +} + +private class KMErrorManagerListenerPlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCErrorManagerListenerProtocol) : KMErrorManagerListener +{ + + override fun onTiledLayerErrorStateChanged(errors: ArrayList) { + nativeHandle.onTiledLayerErrorStateChanged(ArrayList(errors.map { it.asPlatform() })) + } +} + +private class KMErrorManagerListenerPlatformProxy(private val delegate: KMErrorManagerListener) : NSObject(), MapCoreSharedModule.MCErrorManagerListenerProtocol +{ + + override fun onTiledLayerErrorStateChanged(errors: List<*>) { + delegate.onTiledLayerErrorStateChanged(ArrayList(((errors as? List<*>)?.map { (it as MapCoreSharedModule.MCTiledLayerError).asKmp() } ?: (0 until (errors as platform.Foundation.NSArray).count.toInt()).map { idx -> ((errors as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCTiledLayerError).asKmp() }))) + } +} + +internal fun KMErrorManagerListener.asPlatform(): MapCoreSharedModule.MCErrorManagerListenerProtocol = when (this) { + is KMErrorManagerListenerPlatformWrapper -> this.nativeHandle + else -> KMErrorManagerListenerPlatformProxy(this) +} +public fun MapCoreSharedModule.MCErrorManagerListenerProtocol.asKmp(): KMErrorManagerListener = KMErrorManagerListenerPlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerDelegateInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerDelegateInterface.kt new file mode 100644 index 000000000..f353d3302 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerDelegateInterface.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from exception_logger.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMExceptionLoggerDelegateInterface", exact = true) +actual interface KMExceptionLoggerDelegateInterface +{ + + actual fun logMessage(errorDomain: String, code: Int, customValues: HashMap, functionName: String, file: String, line: Int) +} + +private class KMExceptionLoggerDelegateInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCExceptionLoggerDelegateInterfaceProtocol) : KMExceptionLoggerDelegateInterface +{ + + override fun logMessage(errorDomain: String, code: Int, customValues: HashMap, functionName: String, file: String, line: Int) { + nativeHandle.logMessage(errorDomain, code, HashMap(customValues.map { it.key to it.value }.toMap()), functionName, file, line) + } +} + +private class KMExceptionLoggerDelegateInterfacePlatformProxy(private val delegate: KMExceptionLoggerDelegateInterface) : NSObject(), MapCoreSharedModule.MCExceptionLoggerDelegateInterfaceProtocol +{ + + override fun logMessage(errorDomain: String, code: Int, customValues: Map, functionName: String, file: String, line: Int) { + delegate.logMessage(errorDomain, code, HashMap(((customValues as? Map<*, *>)?.map { (it.key as String) to (it.value as String) }?.toMap() ?: run { val e = (customValues as platform.Foundation.NSDictionary).keyEnumerator(); generateSequence { e.nextObject() }.associate { key -> (key as String) to ((customValues as platform.Foundation.NSDictionary).objectForKey(key) as String) } })), functionName, file, line) + } +} + +internal fun KMExceptionLoggerDelegateInterface.asPlatform(): MapCoreSharedModule.MCExceptionLoggerDelegateInterfaceProtocol = when (this) { + is KMExceptionLoggerDelegateInterfacePlatformWrapper -> this.nativeHandle + else -> KMExceptionLoggerDelegateInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCExceptionLoggerDelegateInterfaceProtocol.asKmp(): KMExceptionLoggerDelegateInterface = KMExceptionLoggerDelegateInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerInterface.kt new file mode 100644 index 000000000..0dfe2eb32 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExceptionLoggerInterface.kt @@ -0,0 +1,29 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from exception_logger.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMExceptionLoggerInterface", exact = true) +actual class KMExceptionLoggerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCExceptionLoggerInterface + + actual companion object + { + + actual fun setLoggerDelegate(delegate: KMExceptionLoggerDelegateInterface) { + MapCoreSharedModule.MCExceptionLoggerInterface.setLoggerDelegate(delegate.asPlatform()) + } + } +} + +internal fun KMExceptionLoggerInterface.asPlatform(): MapCoreSharedModule.MCExceptionLoggerInterface = nativeHandle as MapCoreSharedModule.MCExceptionLoggerInterface +public fun MapCoreSharedModule.MCExceptionLoggerInterface.asKmp(): KMExceptionLoggerInterface = KMExceptionLoggerInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExecutionEnvironment.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExecutionEnvironment.kt new file mode 100644 index 000000000..2b5bb04b8 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMExecutionEnvironment.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMExecutionEnvironment", exact = true) +actual enum class KMExecutionEnvironment(val rawValue: Long) { + IO(0L), + COMPUTATION(1L), + GRAPHICS(2L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCExecutionEnvironment): KMExecutionEnvironment { + val raw: Long = value + return when (raw) { + 0L -> KMExecutionEnvironment.IO + 1L -> KMExecutionEnvironment.COMPUTATION + 2L -> KMExecutionEnvironment.GRAPHICS + else -> throw IllegalArgumentException("Unknown KMExecutionEnvironment value: " + raw) + } + } + } +} + +internal fun KMExecutionEnvironment.asPlatform(): MapCoreSharedModule.MCExecutionEnvironment = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFeatureInfoValueFactory.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFeatureInfoValueFactory.kt new file mode 100644 index 000000000..19e0fbb11 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFeatureInfoValueFactory.kt @@ -0,0 +1,60 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMFeatureInfoValueFactory", exact = true) +actual class KMFeatureInfoValueFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCFeatureInfoValueFactory + + actual companion object + { + + actual fun createString(value: String): KMVectorLayerFeatureInfoValue { + val result = MapCoreSharedModule.MCFeatureInfoValueFactory.createString(value) + return (result as MapCoreSharedModule.MCVectorLayerFeatureInfoValue).asKmp() + } + + actual fun createDouble(value: Double): KMVectorLayerFeatureInfoValue { + val result = MapCoreSharedModule.MCFeatureInfoValueFactory.createDouble(value) + return (result as MapCoreSharedModule.MCVectorLayerFeatureInfoValue).asKmp() + } + + actual fun createInt(value: Long): KMVectorLayerFeatureInfoValue { + val result = MapCoreSharedModule.MCFeatureInfoValueFactory.createInt(value) + return (result as MapCoreSharedModule.MCVectorLayerFeatureInfoValue).asKmp() + } + + actual fun createBool(value: Boolean): KMVectorLayerFeatureInfoValue { + val result = MapCoreSharedModule.MCFeatureInfoValueFactory.createBool(value) + return (result as MapCoreSharedModule.MCVectorLayerFeatureInfoValue).asKmp() + } + + actual fun createColor(value: KMColor): KMVectorLayerFeatureInfoValue { + val result = MapCoreSharedModule.MCFeatureInfoValueFactory.createColor(value.asPlatform()) + return (result as MapCoreSharedModule.MCVectorLayerFeatureInfoValue).asKmp() + } + + actual fun createListFloat(value: ArrayList): KMVectorLayerFeatureInfoValue { + val result = MapCoreSharedModule.MCFeatureInfoValueFactory.createListFloat(ArrayList(value.map { platform.Foundation.NSNumber(float = it) })) + return (result as MapCoreSharedModule.MCVectorLayerFeatureInfoValue).asKmp() + } + + actual fun createListString(value: ArrayList): KMVectorLayerFeatureInfoValue { + val result = MapCoreSharedModule.MCFeatureInfoValueFactory.createListString(ArrayList(value.map { it })) + return (result as MapCoreSharedModule.MCVectorLayerFeatureInfoValue).asKmp() + } + } +} + +internal fun KMFeatureInfoValueFactory.asPlatform(): MapCoreSharedModule.MCFeatureInfoValueFactory = nativeHandle as MapCoreSharedModule.MCFeatureInfoValueFactory +public fun MapCoreSharedModule.MCFeatureInfoValueFactory.asKmp(): KMFeatureInfoValueFactory = KMFeatureInfoValueFactory(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFont.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFont.kt new file mode 100644 index 000000000..2601588bd --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFont.kt @@ -0,0 +1,24 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMFont", exact = true) +actual class KMFont actual public constructor( + name: String, +) { + actual val name: String = name +} + +internal fun KMFont.asPlatform(): MapCoreSharedModule.MCFont = MapCoreSharedModule.MCFont( + name = name, +) +public fun MapCoreSharedModule.MCFont.asKmp(): KMFont = KMFont( + name = this.name, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontData.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontData.kt new file mode 100644 index 000000000..b011dc113 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontData.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMFontData", exact = true) +actual class KMFontData actual public constructor( + info: KMFontWrapper, + glyphs: ArrayList, +) { + actual val info: KMFontWrapper = info + actual val glyphs: ArrayList = glyphs +} + +internal fun KMFontData.asPlatform(): MapCoreSharedModule.MCFontData = MapCoreSharedModule.MCFontData( + info = info.asPlatform(), + glyphs = ArrayList(glyphs.map { it.asPlatform() }), +) +public fun MapCoreSharedModule.MCFontData.asKmp(): KMFontData = KMFontData( + info = (this.info as MapCoreSharedModule.MCFontWrapper).asKmp(), + glyphs = ArrayList(((this.glyphs as? List<*>)?.map { (it as MapCoreSharedModule.MCFontGlyph).asKmp() } ?: (0 until (this.glyphs as platform.Foundation.NSArray).count.toInt()).map { idx -> ((this.glyphs as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCFontGlyph).asKmp() })), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontGlyph.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontGlyph.kt new file mode 100644 index 000000000..2c306ba86 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontGlyph.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMFontGlyph", exact = true) +actual class KMFontGlyph actual public constructor( + charCode: String, + advance: KMVec2D, + boundingBoxSize: KMVec2D, + bearing: KMVec2D, + uv: KMQuad2dD, +) { + actual val charCode: String = charCode + actual val advance: KMVec2D = advance + actual val boundingBoxSize: KMVec2D = boundingBoxSize + actual val bearing: KMVec2D = bearing + actual val uv: KMQuad2dD = uv +} + +internal fun KMFontGlyph.asPlatform(): MapCoreSharedModule.MCFontGlyph = MapCoreSharedModule.MCFontGlyph( + charCode = charCode, + advance = advance.asPlatform(), + boundingBoxSize = boundingBoxSize.asPlatform(), + bearing = bearing.asPlatform(), + uv = uv.asPlatform(), +) +public fun MapCoreSharedModule.MCFontGlyph.asKmp(): KMFontGlyph = KMFontGlyph( + charCode = this.charCode, + advance = (this.advance as MapCoreSharedModule.MCVec2D).asKmp(), + boundingBoxSize = (this.boundingBoxSize as MapCoreSharedModule.MCVec2D).asKmp(), + bearing = (this.bearing as MapCoreSharedModule.MCVec2D).asKmp(), + uv = (this.uv as MapCoreSharedModule.MCQuad2dD).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderInterface.kt new file mode 100644 index 000000000..0090687a8 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderInterface.kt @@ -0,0 +1,42 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMFontLoaderInterface", exact = true) +actual interface KMFontLoaderInterface +{ + + actual fun loadFont(font: KMFont): KMFontLoaderResult +} + +private class KMFontLoaderInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCFontLoaderInterfaceProtocol) : KMFontLoaderInterface +{ + + override fun loadFont(font: KMFont): KMFontLoaderResult { + val result = nativeHandle.loadFont(font.asPlatform()) + return (result as MapCoreSharedModule.MCFontLoaderResult).asKmp() + } +} + +private class KMFontLoaderInterfacePlatformProxy(private val delegate: KMFontLoaderInterface) : NSObject(), MapCoreSharedModule.MCFontLoaderInterfaceProtocol +{ + + override fun loadFont(font: MapCoreSharedModule.MCFont): MapCoreSharedModule.MCFontLoaderResult { + val result = delegate.loadFont((font as MapCoreSharedModule.MCFont).asKmp()) + return result.asPlatform() + } +} + +internal fun KMFontLoaderInterface.asPlatform(): MapCoreSharedModule.MCFontLoaderInterfaceProtocol = when (this) { + is KMFontLoaderInterfacePlatformWrapper -> this.nativeHandle + else -> KMFontLoaderInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCFontLoaderInterfaceProtocol.asKmp(): KMFontLoaderInterface = KMFontLoaderInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderResult.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderResult.kt new file mode 100644 index 000000000..447a08e68 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontLoaderResult.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMFontLoaderResult", exact = true) +actual class KMFontLoaderResult actual public constructor( + imageData: KMTextureHolderInterface?, + fontData: KMFontData?, + status: KMLoaderStatus, +) { + actual val imageData: KMTextureHolderInterface? = imageData + actual val fontData: KMFontData? = fontData + actual val status: KMLoaderStatus = status +} + +internal fun KMFontLoaderResult.asPlatform(): MapCoreSharedModule.MCFontLoaderResult = MapCoreSharedModule.MCFontLoaderResult( + imageData = imageData?.let { it.asPlatform() }, + fontData = fontData?.let { it.asPlatform() }, + status = status.asPlatform(), +) +public fun MapCoreSharedModule.MCFontLoaderResult.asKmp(): KMFontLoaderResult = KMFontLoaderResult( + imageData = this.imageData?.let { (it as MapCoreSharedModule.MCTextureHolderInterfaceProtocol).asKmp() }, + fontData = this.fontData?.let { (it as MapCoreSharedModule.MCFontData).asKmp() }, + status = KMLoaderStatus.fromPlatform((this.status as MapCoreSharedModule.MCLoaderStatus)), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontWrapper.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontWrapper.kt new file mode 100644 index 000000000..e6828d944 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFontWrapper.kt @@ -0,0 +1,44 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMFontWrapper", exact = true) +actual class KMFontWrapper actual public constructor( + name: String, + lineHeight: Double, + base: Double, + bitmapSize: KMVec2D, + size: Double, + distanceRange: Double, +) { + actual val name: String = name + actual val lineHeight: Double = lineHeight + actual val base: Double = base + actual val bitmapSize: KMVec2D = bitmapSize + actual val size: Double = size + actual val distanceRange: Double = distanceRange +} + +internal fun KMFontWrapper.asPlatform(): MapCoreSharedModule.MCFontWrapper = MapCoreSharedModule.MCFontWrapper( + name = name, + lineHeight = lineHeight, + base = base, + bitmapSize = bitmapSize.asPlatform(), + size = size, + distanceRange = distanceRange, +) +public fun MapCoreSharedModule.MCFontWrapper.asKmp(): KMFontWrapper = KMFontWrapper( + name = this.name, + lineHeight = this.lineHeight, + base = this.base, + bitmapSize = (this.bitmapSize as MapCoreSharedModule.MCVec2D).asKmp(), + size = this.size, + distanceRange = this.distanceRange, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFormattedStringEntry.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFormattedStringEntry.kt new file mode 100644 index 000000000..c14bb4f5c --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFormattedStringEntry.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMFormattedStringEntry", exact = true) +actual class KMFormattedStringEntry actual public constructor( + text: String, + scale: Float, +) { + actual val text: String = text + actual val scale: Float = scale +} + +internal fun KMFormattedStringEntry.asPlatform(): MapCoreSharedModule.MCFormattedStringEntry = MapCoreSharedModule.MCFormattedStringEntry( + text = text, + scale = scale, +) +public fun MapCoreSharedModule.MCFormattedStringEntry.asKmp(): KMFormattedStringEntry = KMFormattedStringEntry( + text = this.text, + scale = this.scale, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonFeatureParserInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonFeatureParserInterface.kt new file mode 100644 index 000000000..0c2c2b5f2 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonFeatureParserInterface.kt @@ -0,0 +1,45 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from geo_json_parser.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMGeoJsonFeatureParserInterface", exact = true) +actual class KMGeoJsonFeatureParserInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCGeoJsonFeatureParserInterface + + actual fun parse(geoJson: String): ArrayList? { + val result = native.parse(geoJson) + return result?.let { ArrayList(((it as? List<*>)?.map { (it as MapCoreSharedModule.MCVectorLayerFeatureInfo).asKmp() } ?: (0 until (it as platform.Foundation.NSArray).count.toInt()).map { idx -> ((it as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCVectorLayerFeatureInfo).asKmp() })) } + } + + actual fun parseWithPointGeometry(geoJson: String): ArrayList? { + val result = native.parseWithPointGeometry(geoJson) + return result?.let { ArrayList(((it as? List<*>)?.map { (it as MapCoreSharedModule.MCGeoJsonPoint).asKmp() } ?: (0 until (it as platform.Foundation.NSArray).count.toInt()).map { idx -> ((it as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCGeoJsonPoint).asKmp() })) } + } + + actual fun parseWithLineGeometry(geoJson: String): ArrayList? { + val result = native.parseWithLineGeometry(geoJson) + return result?.let { ArrayList(((it as? List<*>)?.map { (it as MapCoreSharedModule.MCGeoJsonLine).asKmp() } ?: (0 until (it as platform.Foundation.NSArray).count.toInt()).map { idx -> ((it as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCGeoJsonLine).asKmp() })) } + } + + actual companion object + { + + actual fun create(): KMGeoJsonFeatureParserInterface { + val result = MapCoreSharedModule.MCGeoJsonFeatureParserInterface.create() + return (result as MapCoreSharedModule.MCGeoJsonFeatureParserInterface).asKmp() + } + } +} + +internal fun KMGeoJsonFeatureParserInterface.asPlatform(): MapCoreSharedModule.MCGeoJsonFeatureParserInterface = nativeHandle as MapCoreSharedModule.MCGeoJsonFeatureParserInterface +public fun MapCoreSharedModule.MCGeoJsonFeatureParserInterface.asKmp(): KMGeoJsonFeatureParserInterface = KMGeoJsonFeatureParserInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonHelperInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonHelperInterface.kt new file mode 100644 index 000000000..bcd43e829 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonHelperInterface.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from geo_json_parser.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMGeoJsonHelperInterface", exact = true) +actual class KMGeoJsonHelperInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCGeoJsonHelperInterface + + actual fun geoJsonStringFromFeatureInfo(point: KMGeoJsonPoint): String { + val result = native.geoJsonStringFromFeatureInfo(point.asPlatform()) + return result + } + + actual fun geoJsonStringFromFeatureInfos(points: ArrayList): String { + val result = native.geoJsonStringFromFeatureInfos(ArrayList(points.map { it.asPlatform() })) + return result + } + + actual companion object + { + + actual fun independentInstance(): KMGeoJsonHelperInterface { + val result = MapCoreSharedModule.MCGeoJsonHelperInterface.independentInstance() + return (result as MapCoreSharedModule.MCGeoJsonHelperInterface).asKmp() + } + } +} + +internal fun KMGeoJsonHelperInterface.asPlatform(): MapCoreSharedModule.MCGeoJsonHelperInterface = nativeHandle as MapCoreSharedModule.MCGeoJsonHelperInterface +public fun MapCoreSharedModule.MCGeoJsonHelperInterface.asKmp(): KMGeoJsonHelperInterface = KMGeoJsonHelperInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonLine.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonLine.kt new file mode 100644 index 000000000..685a8cb8c --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonLine.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from geo_json_parser.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMGeoJsonLine", exact = true) +actual class KMGeoJsonLine actual public constructor( + points: ArrayList, + featureInfo: KMVectorLayerFeatureInfo, +) { + actual val points: ArrayList = points + actual val featureInfo: KMVectorLayerFeatureInfo = featureInfo +} + +internal fun KMGeoJsonLine.asPlatform(): MapCoreSharedModule.MCGeoJsonLine = MapCoreSharedModule.MCGeoJsonLine( + points = ArrayList(points.map { it.asPlatform() }), + featureInfo = featureInfo.asPlatform(), +) +public fun MapCoreSharedModule.MCGeoJsonLine.asKmp(): KMGeoJsonLine = KMGeoJsonLine( + points = ArrayList(((this.points as? List<*>)?.map { (it as MapCoreSharedModule.MCCoord).asKmp() } ?: (0 until (this.points as platform.Foundation.NSArray).count.toInt()).map { idx -> ((this.points as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCCoord).asKmp() })), + featureInfo = (this.featureInfo as MapCoreSharedModule.MCVectorLayerFeatureInfo).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonPoint.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonPoint.kt new file mode 100644 index 000000000..7c1a2012a --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGeoJsonPoint.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from geo_json_parser.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMGeoJsonPoint", exact = true) +actual class KMGeoJsonPoint actual public constructor( + point: KMCoord, + featureInfo: KMVectorLayerFeatureInfo, +) { + actual val point: KMCoord = point + actual val featureInfo: KMVectorLayerFeatureInfo = featureInfo +} + +internal fun KMGeoJsonPoint.asPlatform(): MapCoreSharedModule.MCGeoJsonPoint = MapCoreSharedModule.MCGeoJsonPoint( + point = point.asPlatform(), + featureInfo = featureInfo.asPlatform(), +) +public fun MapCoreSharedModule.MCGeoJsonPoint.asKmp(): KMGeoJsonPoint = KMGeoJsonPoint( + point = (this.point as MapCoreSharedModule.MCCoord).asKmp(), + featureInfo = (this.featureInfo as MapCoreSharedModule.MCVectorLayerFeatureInfo).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGlyphDescription.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGlyphDescription.kt new file mode 100644 index 000000000..fa63d82bd --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGlyphDescription.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMGlyphDescription", exact = true) +actual class KMGlyphDescription actual public constructor( + frame: KMQuad2dD, + textureCoordinates: KMQuad2dD, +) { + actual val frame: KMQuad2dD = frame + actual val textureCoordinates: KMQuad2dD = textureCoordinates +} + +internal fun KMGlyphDescription.asPlatform(): MapCoreSharedModule.MCGlyphDescription = MapCoreSharedModule.MCGlyphDescription( + frame = frame.asPlatform(), + textureCoordinates = textureCoordinates.asPlatform(), +) +public fun MapCoreSharedModule.MCGlyphDescription.asKmp(): KMGlyphDescription = KMGlyphDescription( + frame = (this.frame as MapCoreSharedModule.MCQuad2dD).asKmp(), + textureCoordinates = (this.textureCoordinates as MapCoreSharedModule.MCQuad2dD).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectFactoryInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectFactoryInterface.kt new file mode 100644 index 000000000..ee1df27c9 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectFactoryInterface.kt @@ -0,0 +1,210 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMGraphicsObjectFactoryInterface", exact = true) +actual interface KMGraphicsObjectFactoryInterface +{ + + actual fun createQuad(shader: KMShaderProgramInterface): KMQuad2dInterface + + actual fun createQuadTessellated(shader: KMShaderProgramInterface): KMQuad2dInterface + + actual fun createPolygon(shader: KMShaderProgramInterface): KMPolygon2dInterface + + actual fun createPolygonTessellated(shader: KMShaderProgramInterface): KMPolygon2dInterface + + actual fun createIcosahedronObject(shader: KMShaderProgramInterface): KMIcosahedronInterface + + actual fun createQuadInstanced(shader: KMShaderProgramInterface): KMQuad2dInstancedInterface + + actual fun createQuadStretchedInstanced(shader: KMShaderProgramInterface): KMQuad2dStretchedInstancedInterface + + actual fun createLineGroup(shader: KMShaderProgramInterface): KMLineGroup2dInterface + + actual fun createPolygonGroup(shader: KMShaderProgramInterface): KMPolygonGroup2dInterface + + actual fun createPolygonPatternGroup(shader: KMShaderProgramInterface): KMPolygonPatternGroup2dInterface + + actual fun createQuadMask(is3d: Boolean): KMQuad2dInterface + + actual fun createPolygonMask(is3d: Boolean): KMPolygon2dInterface + + actual fun createPolygonMaskTessellated(is3d: Boolean): KMPolygon2dInterface + + actual fun createText(shader: KMShaderProgramInterface): KMTextInterface + + actual fun createTextInstanced(shader: KMShaderProgramInterface): KMTextInstancedInterface +} + +private class KMGraphicsObjectFactoryInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCGraphicsObjectFactoryInterfaceProtocol) : KMGraphicsObjectFactoryInterface +{ + + override fun createQuad(shader: KMShaderProgramInterface): KMQuad2dInterface { + val result = nativeHandle.createQuad(shader.asPlatform()) + return (result as MapCoreSharedModule.MCQuad2dInterfaceProtocol).asKmp() + } + + override fun createQuadTessellated(shader: KMShaderProgramInterface): KMQuad2dInterface { + val result = nativeHandle.createQuadTessellated(shader.asPlatform()) + return (result as MapCoreSharedModule.MCQuad2dInterfaceProtocol).asKmp() + } + + override fun createPolygon(shader: KMShaderProgramInterface): KMPolygon2dInterface { + val result = nativeHandle.createPolygon(shader.asPlatform()) + return (result as MapCoreSharedModule.MCPolygon2dInterfaceProtocol).asKmp() + } + + override fun createPolygonTessellated(shader: KMShaderProgramInterface): KMPolygon2dInterface { + val result = nativeHandle.createPolygonTessellated(shader.asPlatform()) + return (result as MapCoreSharedModule.MCPolygon2dInterfaceProtocol).asKmp() + } + + override fun createIcosahedronObject(shader: KMShaderProgramInterface): KMIcosahedronInterface { + val result = nativeHandle.createIcosahedronObject(shader.asPlatform()) + return (result as MapCoreSharedModule.MCIcosahedronInterfaceProtocol).asKmp() + } + + override fun createQuadInstanced(shader: KMShaderProgramInterface): KMQuad2dInstancedInterface { + val result = nativeHandle.createQuadInstanced(shader.asPlatform()) + return (result as MapCoreSharedModule.MCQuad2dInstancedInterfaceProtocol).asKmp() + } + + override fun createQuadStretchedInstanced(shader: KMShaderProgramInterface): KMQuad2dStretchedInstancedInterface { + val result = nativeHandle.createQuadStretchedInstanced(shader.asPlatform()) + return (result as MapCoreSharedModule.MCQuad2dStretchedInstancedInterfaceProtocol).asKmp() + } + + override fun createLineGroup(shader: KMShaderProgramInterface): KMLineGroup2dInterface { + val result = nativeHandle.createLineGroup(shader.asPlatform()) + return (result as MapCoreSharedModule.MCLineGroup2dInterfaceProtocol).asKmp() + } + + override fun createPolygonGroup(shader: KMShaderProgramInterface): KMPolygonGroup2dInterface { + val result = nativeHandle.createPolygonGroup(shader.asPlatform()) + return (result as MapCoreSharedModule.MCPolygonGroup2dInterfaceProtocol).asKmp() + } + + override fun createPolygonPatternGroup(shader: KMShaderProgramInterface): KMPolygonPatternGroup2dInterface { + val result = nativeHandle.createPolygonPatternGroup(shader.asPlatform()) + return (result as MapCoreSharedModule.MCPolygonPatternGroup2dInterfaceProtocol).asKmp() + } + + override fun createQuadMask(is3d: Boolean): KMQuad2dInterface { + val result = nativeHandle.createQuadMask(is3d) + return (result as MapCoreSharedModule.MCQuad2dInterfaceProtocol).asKmp() + } + + override fun createPolygonMask(is3d: Boolean): KMPolygon2dInterface { + val result = nativeHandle.createPolygonMask(is3d) + return (result as MapCoreSharedModule.MCPolygon2dInterfaceProtocol).asKmp() + } + + override fun createPolygonMaskTessellated(is3d: Boolean): KMPolygon2dInterface { + val result = nativeHandle.createPolygonMaskTessellated(is3d) + return (result as MapCoreSharedModule.MCPolygon2dInterfaceProtocol).asKmp() + } + + override fun createText(shader: KMShaderProgramInterface): KMTextInterface { + val result = nativeHandle.createText(shader.asPlatform()) + return (result as MapCoreSharedModule.MCTextInterfaceProtocol).asKmp() + } + + override fun createTextInstanced(shader: KMShaderProgramInterface): KMTextInstancedInterface { + val result = nativeHandle.createTextInstanced(shader.asPlatform()) + return (result as MapCoreSharedModule.MCTextInstancedInterfaceProtocol).asKmp() + } +} + +private class KMGraphicsObjectFactoryInterfacePlatformProxy(private val delegate: KMGraphicsObjectFactoryInterface) : NSObject(), MapCoreSharedModule.MCGraphicsObjectFactoryInterfaceProtocol +{ + + override fun createQuad(shader: MapCoreSharedModule.MCShaderProgramInterfaceProtocol?): MapCoreSharedModule.MCQuad2dInterfaceProtocol? { + val result = delegate.createQuad((shader as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp()) + return result.asPlatform() + } + + override fun createQuadTessellated(shader: MapCoreSharedModule.MCShaderProgramInterfaceProtocol?): MapCoreSharedModule.MCQuad2dInterfaceProtocol? { + val result = delegate.createQuadTessellated((shader as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp()) + return result.asPlatform() + } + + override fun createPolygon(shader: MapCoreSharedModule.MCShaderProgramInterfaceProtocol?): MapCoreSharedModule.MCPolygon2dInterfaceProtocol? { + val result = delegate.createPolygon((shader as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp()) + return result.asPlatform() + } + + override fun createPolygonTessellated(shader: MapCoreSharedModule.MCShaderProgramInterfaceProtocol?): MapCoreSharedModule.MCPolygon2dInterfaceProtocol? { + val result = delegate.createPolygonTessellated((shader as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp()) + return result.asPlatform() + } + + override fun createIcosahedronObject(shader: MapCoreSharedModule.MCShaderProgramInterfaceProtocol?): MapCoreSharedModule.MCIcosahedronInterfaceProtocol? { + val result = delegate.createIcosahedronObject((shader as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp()) + return result.asPlatform() + } + + override fun createQuadInstanced(shader: MapCoreSharedModule.MCShaderProgramInterfaceProtocol?): MapCoreSharedModule.MCQuad2dInstancedInterfaceProtocol? { + val result = delegate.createQuadInstanced((shader as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp()) + return result.asPlatform() + } + + override fun createQuadStretchedInstanced(shader: MapCoreSharedModule.MCShaderProgramInterfaceProtocol?): MapCoreSharedModule.MCQuad2dStretchedInstancedInterfaceProtocol? { + val result = delegate.createQuadStretchedInstanced((shader as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp()) + return result.asPlatform() + } + + override fun createLineGroup(shader: MapCoreSharedModule.MCShaderProgramInterfaceProtocol?): MapCoreSharedModule.MCLineGroup2dInterfaceProtocol? { + val result = delegate.createLineGroup((shader as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp()) + return result.asPlatform() + } + + override fun createPolygonGroup(shader: MapCoreSharedModule.MCShaderProgramInterfaceProtocol?): MapCoreSharedModule.MCPolygonGroup2dInterfaceProtocol? { + val result = delegate.createPolygonGroup((shader as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp()) + return result.asPlatform() + } + + override fun createPolygonPatternGroup(shader: MapCoreSharedModule.MCShaderProgramInterfaceProtocol?): MapCoreSharedModule.MCPolygonPatternGroup2dInterfaceProtocol? { + val result = delegate.createPolygonPatternGroup((shader as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp()) + return result.asPlatform() + } + + override fun createQuadMask(is3d: Boolean): MapCoreSharedModule.MCQuad2dInterfaceProtocol? { + val result = delegate.createQuadMask(is3d) + return result.asPlatform() + } + + override fun createPolygonMask(is3d: Boolean): MapCoreSharedModule.MCPolygon2dInterfaceProtocol? { + val result = delegate.createPolygonMask(is3d) + return result.asPlatform() + } + + override fun createPolygonMaskTessellated(is3d: Boolean): MapCoreSharedModule.MCPolygon2dInterfaceProtocol? { + val result = delegate.createPolygonMaskTessellated(is3d) + return result.asPlatform() + } + + override fun createText(shader: MapCoreSharedModule.MCShaderProgramInterfaceProtocol?): MapCoreSharedModule.MCTextInterfaceProtocol? { + val result = delegate.createText((shader as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp()) + return result.asPlatform() + } + + override fun createTextInstanced(shader: MapCoreSharedModule.MCShaderProgramInterfaceProtocol?): MapCoreSharedModule.MCTextInstancedInterfaceProtocol? { + val result = delegate.createTextInstanced((shader as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp()) + return result.asPlatform() + } +} + +internal fun KMGraphicsObjectFactoryInterface.asPlatform(): MapCoreSharedModule.MCGraphicsObjectFactoryInterfaceProtocol = when (this) { + is KMGraphicsObjectFactoryInterfacePlatformWrapper -> this.nativeHandle + else -> KMGraphicsObjectFactoryInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCGraphicsObjectFactoryInterfaceProtocol.asKmp(): KMGraphicsObjectFactoryInterface = KMGraphicsObjectFactoryInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectInterface.kt new file mode 100644 index 000000000..135e86194 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMGraphicsObjectInterface.kt @@ -0,0 +1,92 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMGraphicsObjectInterface", exact = true) +actual interface KMGraphicsObjectInterface +{ + + actual fun isReady(): Boolean + + actual fun setup(context: KMRenderingContextInterface) + + actual fun clear() + + actual fun setIsInverseMasked(inversed: Boolean) + + actual fun setDebugLabel(label: String) + + actual fun render(context: KMRenderingContextInterface, renderPass: KMRenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: KMVec3D, isMasked: Boolean, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) +} + +private class KMGraphicsObjectInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol) : KMGraphicsObjectInterface +{ + + override fun isReady(): Boolean { + val result = nativeHandle.isReady() + return result + } + + override fun setup(context: KMRenderingContextInterface) { + nativeHandle.setup(context.asPlatform()) + } + + override fun clear() { + nativeHandle.clear() + } + + override fun setIsInverseMasked(inversed: Boolean) { + nativeHandle.setIsInverseMasked(inversed) + } + + override fun setDebugLabel(label: String) { + nativeHandle.setDebugLabel(label) + } + + override fun render(context: KMRenderingContextInterface, renderPass: KMRenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: KMVec3D, isMasked: Boolean, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) { + nativeHandle.render(context.asPlatform(), renderPass.asPlatform(), vpMatrix, mMatrix, origin.asPlatform(), isMasked, screenPixelAsRealMeterFactor, isScreenSpaceCoords) + } +} + +private class KMGraphicsObjectInterfacePlatformProxy(private val delegate: KMGraphicsObjectInterface) : NSObject(), MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol +{ + + override fun isReady(): Boolean { + val result = delegate.isReady() + return result + } + + override fun setup(context: MapCoreSharedModule.MCRenderingContextInterfaceProtocol?) { + delegate.setup((context as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp()) + } + + override fun clear() { + delegate.clear() + } + + override fun setIsInverseMasked(inversed: Boolean) { + delegate.setIsInverseMasked(inversed) + } + + override fun setDebugLabel(label: String) { + delegate.setDebugLabel(label) + } + + override fun render(context: MapCoreSharedModule.MCRenderingContextInterfaceProtocol?, renderPass: MapCoreSharedModule.MCRenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: MapCoreSharedModule.MCVec3D, isMasked: Boolean, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) { + delegate.render((context as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp(), (renderPass as MapCoreSharedModule.MCRenderPassConfig).asKmp(), vpMatrix, mMatrix, (origin as MapCoreSharedModule.MCVec3D).asKmp(), isMasked, screenPixelAsRealMeterFactor, isScreenSpaceCoords) + } +} + +internal fun KMGraphicsObjectInterface.asPlatform(): MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol = when (this) { + is KMGraphicsObjectInterfacePlatformWrapper -> this.nativeHandle + else -> KMGraphicsObjectInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol.asKmp(): KMGraphicsObjectInterface = KMGraphicsObjectInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconFactory.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconFactory.kt new file mode 100644 index 000000000..4e9066f11 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconFactory.kt @@ -0,0 +1,35 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMIconFactory", exact = true) +actual class KMIconFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCIconFactory + + actual companion object + { + + actual fun createIcon(identifier: String, coordinate: KMCoord, texture: KMTextureHolderInterface, iconSize: KMVec2F, scaleType: KMIconType, blendMode: KMBlendMode): KMIconInfoInterface { + val result = MapCoreSharedModule.MCIconFactory.createIcon(identifier, coordinate.asPlatform(), texture.asPlatform(), iconSize.asPlatform(), scaleType.asPlatform(), blendMode.asPlatform()) + return (result as MapCoreSharedModule.MCIconInfoInterface).asKmp() + } + + actual fun createIconWithAnchor(identifier: String, coordinate: KMCoord, texture: KMTextureHolderInterface, iconSize: KMVec2F, scaleType: KMIconType, blendMode: KMBlendMode, iconAnchor: KMVec2F): KMIconInfoInterface { + val result = MapCoreSharedModule.MCIconFactory.createIconWithAnchor(identifier, coordinate.asPlatform(), texture.asPlatform(), iconSize.asPlatform(), scaleType.asPlatform(), blendMode.asPlatform(), iconAnchor.asPlatform()) + return (result as MapCoreSharedModule.MCIconInfoInterface).asKmp() + } + } +} + +internal fun KMIconFactory.asPlatform(): MapCoreSharedModule.MCIconFactory = nativeHandle as MapCoreSharedModule.MCIconFactory +public fun MapCoreSharedModule.MCIconFactory.asKmp(): KMIconFactory = KMIconFactory(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconInfoInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconInfoInterface.kt new file mode 100644 index 000000000..d30b9eef6 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconInfoInterface.kt @@ -0,0 +1,68 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMIconInfoInterface", exact = true) +actual class KMIconInfoInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCIconInfoInterface + + actual fun getIdentifier(): String { + val result = native.getIdentifier() + return result + } + + actual fun getTexture(): KMTextureHolderInterface { + val result = native.getTexture() + return (result as MapCoreSharedModule.MCTextureHolderInterfaceProtocol).asKmp() + } + + actual fun setCoordinate(coord: KMCoord) { + native.setCoordinate(coord.asPlatform()) + } + + actual fun getCoordinate(): KMCoord { + val result = native.getCoordinate() + return (result as MapCoreSharedModule.MCCoord).asKmp() + } + + actual fun setIconSize(size: KMVec2F) { + native.setIconSize(size.asPlatform()) + } + + actual fun getIconSize(): KMVec2F { + val result = native.getIconSize() + return (result as MapCoreSharedModule.MCVec2F).asKmp() + } + + actual fun setType(scaleType: KMIconType) { + native.setType(scaleType.asPlatform()) + } + + actual fun getType(): KMIconType { + val result = native.getType() + return KMIconType.fromPlatform((result as MapCoreSharedModule.MCIconType)) + } + + actual fun getIconAnchor(): KMVec2F { + val result = native.getIconAnchor() + return (result as MapCoreSharedModule.MCVec2F).asKmp() + } + + actual fun getBlendMode(): KMBlendMode { + val result = native.getBlendMode() + return KMBlendMode.fromPlatform((result as MapCoreSharedModule.MCBlendMode)) + } +} + +internal fun KMIconInfoInterface.asPlatform(): MapCoreSharedModule.MCIconInfoInterface = nativeHandle as MapCoreSharedModule.MCIconInfoInterface +public fun MapCoreSharedModule.MCIconInfoInterface.asKmp(): KMIconInfoInterface = KMIconInfoInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerCallbackInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerCallbackInterface.kt new file mode 100644 index 000000000..d35cdca47 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerCallbackInterface.kt @@ -0,0 +1,54 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMIconLayerCallbackInterface", exact = true) +actual interface KMIconLayerCallbackInterface +{ + + actual fun onClickConfirmed(icons: ArrayList): Boolean + + actual fun onLongPress(icons: ArrayList): Boolean +} + +private class KMIconLayerCallbackInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCIconLayerCallbackInterfaceProtocol) : KMIconLayerCallbackInterface +{ + + override fun onClickConfirmed(icons: ArrayList): Boolean { + val result = nativeHandle.onClickConfirmed(ArrayList(icons.map { it.asPlatform() })) + return result + } + + override fun onLongPress(icons: ArrayList): Boolean { + val result = nativeHandle.onLongPress(ArrayList(icons.map { it.asPlatform() })) + return result + } +} + +private class KMIconLayerCallbackInterfacePlatformProxy(private val delegate: KMIconLayerCallbackInterface) : NSObject(), MapCoreSharedModule.MCIconLayerCallbackInterfaceProtocol +{ + + override fun onClickConfirmed(icons: List<*>): Boolean { + val result = delegate.onClickConfirmed(ArrayList(((icons as? List<*>)?.map { (it as MapCoreSharedModule.MCIconInfoInterface).asKmp() } ?: (0 until (icons as platform.Foundation.NSArray).count.toInt()).map { idx -> ((icons as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCIconInfoInterface).asKmp() }))) + return result + } + + override fun onLongPress(icons: List<*>): Boolean { + val result = delegate.onLongPress(ArrayList(((icons as? List<*>)?.map { (it as MapCoreSharedModule.MCIconInfoInterface).asKmp() } ?: (0 until (icons as platform.Foundation.NSArray).count.toInt()).map { idx -> ((icons as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCIconInfoInterface).asKmp() }))) + return result + } +} + +internal fun KMIconLayerCallbackInterface.asPlatform(): MapCoreSharedModule.MCIconLayerCallbackInterfaceProtocol = when (this) { + is KMIconLayerCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMIconLayerCallbackInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCIconLayerCallbackInterfaceProtocol.asKmp(): KMIconLayerCallbackInterface = KMIconLayerCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerInterface.kt new file mode 100644 index 000000000..df4e14ab7 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconLayerInterface.kt @@ -0,0 +1,92 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMIconLayerInterface", exact = true) +actual class KMIconLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCIconLayerInterface + + actual fun setIcons(icons: ArrayList) { + native.setIcons(ArrayList(icons.map { it.asPlatform() })) + } + + actual fun getIcons(): ArrayList { + val result = native.getIcons() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCIconInfoInterface).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCIconInfoInterface).asKmp() })) + } + + actual fun remove(icon: KMIconInfoInterface) { + native.remove(icon.asPlatform()) + } + + actual fun removeList(icons: ArrayList) { + native.removeList(ArrayList(icons.map { it.asPlatform() })) + } + + actual fun removeIdentifier(identifier: String) { + native.removeIdentifier(identifier) + } + + actual fun removeIdentifierList(identifiers: ArrayList) { + native.removeIdentifierList(ArrayList(identifiers.map { it })) + } + + actual fun add(icon: KMIconInfoInterface) { + native.add(icon.asPlatform()) + } + + actual fun addList(icons: ArrayList) { + native.addList(ArrayList(icons.map { it.asPlatform() })) + } + + actual fun clear() { + native.clear() + } + + actual fun setCallbackHandler(handler: KMIconLayerCallbackInterface) { + native.setCallbackHandler(handler.asPlatform()) + } + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as MapCoreSharedModule.MCLayerInterfaceProtocol).asKmp() + } + + actual fun invalidate() { + native.invalidate() + } + + actual fun setLayerClickable(isLayerClickable: Boolean) { + native.setLayerClickable(isLayerClickable) + } + + actual fun setRenderPassIndex(index: Int) { + native.setRenderPassIndex(index) + } + + actual fun animateIconScale(identifier: String, from: Float, to: Float, duration: Float, repetitions: Int) { + native.animateIconScale(identifier, from, to, duration, repetitions) + } + + actual companion object + { + + actual fun create(): KMIconLayerInterface { + val result = MapCoreSharedModule.MCIconLayerInterface.create() + return (result as MapCoreSharedModule.MCIconLayerInterface).asKmp() + } + } +} + +internal fun KMIconLayerInterface.asPlatform(): MapCoreSharedModule.MCIconLayerInterface = nativeHandle as MapCoreSharedModule.MCIconLayerInterface +public fun MapCoreSharedModule.MCIconLayerInterface.asKmp(): KMIconLayerInterface = KMIconLayerInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconTextFit.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconTextFit.kt new file mode 100644 index 000000000..331895dc5 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconTextFit.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMIconTextFit", exact = true) +actual enum class KMIconTextFit(val rawValue: Long) { + NONE(0L), + WIDTH(1L), + HEIGHT(2L), + BOTH(3L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCIconTextFit): KMIconTextFit { + val raw: Long = value + return when (raw) { + 0L -> KMIconTextFit.NONE + 1L -> KMIconTextFit.WIDTH + 2L -> KMIconTextFit.HEIGHT + 3L -> KMIconTextFit.BOTH + else -> throw IllegalArgumentException("Unknown KMIconTextFit value: " + raw) + } + } + } +} + +internal fun KMIconTextFit.asPlatform(): MapCoreSharedModule.MCIconTextFit = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconType.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconType.kt new file mode 100644 index 000000000..9a0388dae --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIconType.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icon.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMIconType", exact = true) +actual enum class KMIconType(val rawValue: Long) { + SCALE_INVARIANT(0L), + ROTATION_INVARIANT(1L), + INVARIANT(2L), + FIXED(3L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCIconType): KMIconType { + val raw: Long = value + return when (raw) { + 0L -> KMIconType.SCALE_INVARIANT + 1L -> KMIconType.ROTATION_INVARIANT + 2L -> KMIconType.INVARIANT + 3L -> KMIconType.FIXED + else -> throw IllegalArgumentException("Unknown KMIconType value: " + raw) + } + } + } +} + +internal fun KMIconType.asPlatform(): MapCoreSharedModule.MCIconType = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronInterface.kt new file mode 100644 index 000000000..4414daadd --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronInterface.kt @@ -0,0 +1,52 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMIcosahedronInterface", exact = true) +actual interface KMIcosahedronInterface +{ + + actual fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) + + actual fun asGraphicsObject(): KMGraphicsObjectInterface +} + +private class KMIcosahedronInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCIcosahedronInterfaceProtocol) : KMIcosahedronInterface +{ + + override fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) { + nativeHandle.setVertices(vertices.asPlatform(), indices.asPlatform(), origin.asPlatform()) + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol).asKmp() + } +} + +private class KMIcosahedronInterfacePlatformProxy(private val delegate: KMIcosahedronInterface) : NSObject(), MapCoreSharedModule.MCIcosahedronInterfaceProtocol +{ + + override fun setVertices(vertices: MapCoreSharedModule.MCSharedBytes, indices: MapCoreSharedModule.MCSharedBytes, origin: MapCoreSharedModule.MCVec3D) { + delegate.setVertices((vertices as MapCoreSharedModule.MCSharedBytes).asKmp(), (indices as MapCoreSharedModule.MCSharedBytes).asKmp(), (origin as MapCoreSharedModule.MCVec3D).asKmp()) + } + + override fun asGraphicsObject(): MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol? { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } +} + +internal fun KMIcosahedronInterface.asPlatform(): MapCoreSharedModule.MCIcosahedronInterfaceProtocol = when (this) { + is KMIcosahedronInterfacePlatformWrapper -> this.nativeHandle + else -> KMIcosahedronInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCIcosahedronInterfaceProtocol.asKmp(): KMIcosahedronInterface = KMIcosahedronInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerCallbackInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerCallbackInterface.kt new file mode 100644 index 000000000..898f0177d --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerCallbackInterface.kt @@ -0,0 +1,42 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icosahedron.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMIcosahedronLayerCallbackInterface", exact = true) +actual interface KMIcosahedronLayerCallbackInterface +{ + + actual fun getData(): KMFuture +} + +private class KMIcosahedronLayerCallbackInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCIcosahedronLayerCallbackInterfaceProtocol) : KMIcosahedronLayerCallbackInterface +{ + + override fun getData(): KMFuture { + val result = nativeHandle.getData() + return (result as MapCoreSharedModule.DJFuture).asKmp() + } +} + +private class KMIcosahedronLayerCallbackInterfacePlatformProxy(private val delegate: KMIcosahedronLayerCallbackInterface) : NSObject(), MapCoreSharedModule.MCIcosahedronLayerCallbackInterfaceProtocol +{ + + override fun getData(): MapCoreSharedModule.DJFuture { + val result = delegate.getData() + return result.asPlatform() + } +} + +internal fun KMIcosahedronLayerCallbackInterface.asPlatform(): MapCoreSharedModule.MCIcosahedronLayerCallbackInterfaceProtocol = when (this) { + is KMIcosahedronLayerCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMIcosahedronLayerCallbackInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCIcosahedronLayerCallbackInterfaceProtocol.asKmp(): KMIcosahedronLayerCallbackInterface = KMIcosahedronLayerCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerInterface.kt new file mode 100644 index 000000000..a556fcbfb --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIcosahedronLayerInterface.kt @@ -0,0 +1,35 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from icosahedron.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMIcosahedronLayerInterface", exact = true) +actual class KMIcosahedronLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCIcosahedronLayerInterface + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as MapCoreSharedModule.MCLayerInterfaceProtocol).asKmp() + } + + actual companion object + { + + actual fun create(callbackHandler: KMIcosahedronLayerCallbackInterface): KMIcosahedronLayerInterface { + val result = MapCoreSharedModule.MCIcosahedronLayerInterface.create(callbackHandler.asPlatform()) + return (result as MapCoreSharedModule.MCIcosahedronLayerInterface).asKmp() + } + } +} + +internal fun KMIcosahedronLayerInterface.asPlatform(): MapCoreSharedModule.MCIcosahedronLayerInterface = nativeHandle as MapCoreSharedModule.MCIcosahedronLayerInterface +public fun MapCoreSharedModule.MCIcosahedronLayerInterface.asKmp(): KMIcosahedronLayerInterface = KMIcosahedronLayerInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIndexedLayerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIndexedLayerInterface.kt new file mode 100644 index 000000000..826ee9f45 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMIndexedLayerInterface.kt @@ -0,0 +1,54 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMIndexedLayerInterface", exact = true) +actual interface KMIndexedLayerInterface +{ + + actual fun getLayerInterface(): KMLayerInterface + + actual fun getIndex(): Int +} + +private class KMIndexedLayerInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCIndexedLayerInterfaceProtocol) : KMIndexedLayerInterface +{ + + override fun getLayerInterface(): KMLayerInterface { + val result = nativeHandle.getLayerInterface() + return (result as MapCoreSharedModule.MCLayerInterfaceProtocol).asKmp() + } + + override fun getIndex(): Int { + val result = nativeHandle.getIndex() + return result + } +} + +private class KMIndexedLayerInterfacePlatformProxy(private val delegate: KMIndexedLayerInterface) : NSObject(), MapCoreSharedModule.MCIndexedLayerInterfaceProtocol +{ + + override fun getLayerInterface(): MapCoreSharedModule.MCLayerInterfaceProtocol? { + val result = delegate.getLayerInterface() + return result.asPlatform() + } + + override fun getIndex(): Int { + val result = delegate.getIndex() + return result + } +} + +internal fun KMIndexedLayerInterface.asPlatform(): MapCoreSharedModule.MCIndexedLayerInterfaceProtocol = when (this) { + is KMIndexedLayerInterfacePlatformWrapper -> this.nativeHandle + else -> KMIndexedLayerInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCIndexedLayerInterfaceProtocol.asKmp(): KMIndexedLayerInterface = KMIndexedLayerInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerInterface.kt new file mode 100644 index 000000000..17f6e2ac6 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerInterface.kt @@ -0,0 +1,218 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLayerInterface", exact = true) +actual interface KMLayerInterface +{ + + actual fun setMaskingObject(maskingObject: KMMaskingObjectInterface?) + + actual fun update() + + actual fun buildRenderPasses(): ArrayList + + actual fun buildComputePasses(): ArrayList + + actual fun onAdded(mapInterface: KMMapInterface, layerIndex: Int) + + actual fun onRemoved() + + actual fun pause() + + actual fun resume() + + actual fun hide() + + actual fun show() + + actual fun setAlpha(alpha: Float) + + actual fun getAlpha(): Float + + actual fun setScissorRect(scissorRect: KMRectI?) + + actual fun isReadyToRenderOffscreen(): KMLayerReadyState + + actual fun enableAnimations(enabled: Boolean) + + actual fun setErrorManager(errorManager: KMErrorManager) + + actual fun forceReload() + + actual fun setPrimaryRenderTarget(target: KMRenderTargetInterface?) +} + +private class KMLayerInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCLayerInterfaceProtocol) : KMLayerInterface +{ + + override fun setMaskingObject(maskingObject: KMMaskingObjectInterface?) { + nativeHandle.setMaskingObject(maskingObject?.let { it.asPlatform() }) + } + + override fun update() { + nativeHandle.update() + } + + override fun buildRenderPasses(): ArrayList { + val result = nativeHandle.buildRenderPasses() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCRenderPassInterfaceProtocol).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCRenderPassInterfaceProtocol).asKmp() })) + } + + override fun buildComputePasses(): ArrayList { + val result = nativeHandle.buildComputePasses() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCComputePassInterfaceProtocol).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCComputePassInterfaceProtocol).asKmp() })) + } + + override fun onAdded(mapInterface: KMMapInterface, layerIndex: Int) { + nativeHandle.onAdded(mapInterface.asPlatform(), layerIndex) + } + + override fun onRemoved() { + nativeHandle.onRemoved() + } + + override fun pause() { + nativeHandle.pause() + } + + override fun resume() { + nativeHandle.resume() + } + + override fun hide() { + nativeHandle.hide() + } + + override fun show() { + nativeHandle.show() + } + + override fun setAlpha(alpha: Float) { + nativeHandle.setAlpha(alpha) + } + + override fun getAlpha(): Float { + val result = nativeHandle.getAlpha() + return result + } + + override fun setScissorRect(scissorRect: KMRectI?) { + nativeHandle.setScissorRect(scissorRect?.let { it.asPlatform() }) + } + + override fun isReadyToRenderOffscreen(): KMLayerReadyState { + val result = nativeHandle.isReadyToRenderOffscreen() + return KMLayerReadyState.fromPlatform((result as MapCoreSharedModule.MCLayerReadyState)) + } + + override fun enableAnimations(enabled: Boolean) { + nativeHandle.enableAnimations(enabled) + } + + override fun setErrorManager(errorManager: KMErrorManager) { + nativeHandle.setErrorManager(errorManager.asPlatform()) + } + + override fun forceReload() { + nativeHandle.forceReload() + } + + override fun setPrimaryRenderTarget(target: KMRenderTargetInterface?) { + nativeHandle.setPrimaryRenderTarget(target?.let { it.asPlatform() }) + } +} + +private class KMLayerInterfacePlatformProxy(private val delegate: KMLayerInterface) : NSObject(), MapCoreSharedModule.MCLayerInterfaceProtocol +{ + + override fun setMaskingObject(maskingObject: MapCoreSharedModule.MCMaskingObjectInterfaceProtocol?) { + delegate.setMaskingObject(maskingObject?.let { (it as MapCoreSharedModule.MCMaskingObjectInterfaceProtocol).asKmp() }) + } + + override fun update() { + delegate.update() + } + + override fun buildRenderPasses(): List<*> { + val result = delegate.buildRenderPasses() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun buildComputePasses(): List<*> { + val result = delegate.buildComputePasses() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun onAdded(mapInterface: MapCoreSharedModule.MCMapInterface?, layerIndex: Int) { + delegate.onAdded((mapInterface as MapCoreSharedModule.MCMapInterface).asKmp(), layerIndex) + } + + override fun onRemoved() { + delegate.onRemoved() + } + + override fun pause() { + delegate.pause() + } + + override fun resume() { + delegate.resume() + } + + override fun hide() { + delegate.hide() + } + + override fun show() { + delegate.show() + } + + override fun setAlpha(alpha: Float) { + delegate.setAlpha(alpha) + } + + override fun getAlpha(): Float { + val result = delegate.getAlpha() + return result + } + + override fun setScissorRect(scissorRect: MapCoreSharedModule.MCRectI?) { + delegate.setScissorRect(scissorRect?.let { (it as MapCoreSharedModule.MCRectI).asKmp() }) + } + + override fun isReadyToRenderOffscreen(): MapCoreSharedModule.MCLayerReadyState { + val result = delegate.isReadyToRenderOffscreen() + return result.asPlatform() + } + + override fun enableAnimations(enabled: Boolean) { + delegate.enableAnimations(enabled) + } + + override fun setErrorManager(errorManager: MapCoreSharedModule.MCErrorManager?) { + delegate.setErrorManager((errorManager as MapCoreSharedModule.MCErrorManager).asKmp()) + } + + override fun forceReload() { + delegate.forceReload() + } + + override fun setPrimaryRenderTarget(target: MapCoreSharedModule.MCRenderTargetInterfaceProtocol?) { + delegate.setPrimaryRenderTarget(target?.let { (it as MapCoreSharedModule.MCRenderTargetInterfaceProtocol).asKmp() }) + } +} + +internal fun KMLayerInterface.asPlatform(): MapCoreSharedModule.MCLayerInterfaceProtocol = when (this) { + is KMLayerInterfacePlatformWrapper -> this.nativeHandle + else -> KMLayerInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCLayerInterfaceProtocol.asKmp(): KMLayerInterface = KMLayerInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerObjectInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerObjectInterface.kt new file mode 100644 index 000000000..95b7fd382 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerObjectInterface.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from layer_object.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLayerObjectInterface", exact = true) +actual class KMLayerObjectInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCLayerObjectInterface + + actual fun update() { + native.update() + } + + actual fun getRenderConfig(): ArrayList { + val result = native.getRenderConfig() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCRenderConfigInterface).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCRenderConfigInterface).asKmp() })) + } +} + +internal fun KMLayerObjectInterface.asPlatform(): MapCoreSharedModule.MCLayerObjectInterface = nativeHandle as MapCoreSharedModule.MCLayerObjectInterface +public fun MapCoreSharedModule.MCLayerObjectInterface.asKmp(): KMLayerObjectInterface = KMLayerObjectInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerReadyState.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerReadyState.kt new file mode 100644 index 000000000..9408c5947 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLayerReadyState.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLayerReadyState", exact = true) +actual enum class KMLayerReadyState(val rawValue: Long) { + READY(0L), + NOT_READY(1L), + ERROR(2L), + TIMEOUT_ERROR(3L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCLayerReadyState): KMLayerReadyState { + val raw: Long = value + return when (raw) { + 0L -> KMLayerReadyState.READY + 1L -> KMLayerReadyState.NOT_READY + 2L -> KMLayerReadyState.ERROR + 3L -> KMLayerReadyState.TIMEOUT_ERROR + else -> throw IllegalArgumentException("Unknown KMLayerReadyState value: " + raw) + } + } + } +} + +internal fun KMLayerReadyState.asPlatform(): MapCoreSharedModule.MCLayerReadyState = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineCapType.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineCapType.kt new file mode 100644 index 000000000..f09894ea0 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineCapType.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLineCapType", exact = true) +actual enum class KMLineCapType(val rawValue: Long) { + BUTT(0L), + ROUND(1L), + SQUARE(2L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCLineCapType): KMLineCapType { + val raw: Long = value + return when (raw) { + 0L -> KMLineCapType.BUTT + 1L -> KMLineCapType.ROUND + 2L -> KMLineCapType.SQUARE + else -> throw IllegalArgumentException("Unknown KMLineCapType value: " + raw) + } + } + } +} + +internal fun KMLineCapType.asPlatform(): MapCoreSharedModule.MCLineCapType = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineFactory.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineFactory.kt new file mode 100644 index 000000000..3a543ee38 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineFactory.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLineFactory", exact = true) +actual class KMLineFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCLineFactory + + actual companion object + { + + actual fun createLine(identifier: String, coordinates: ArrayList, style: KMLineStyle): KMLineInfoInterface { + val result = MapCoreSharedModule.MCLineFactory.createLine(identifier, ArrayList(coordinates.map { it.asPlatform() }), style.asPlatform()) + return (result as MapCoreSharedModule.MCLineInfoInterface).asKmp() + } + } +} + +internal fun KMLineFactory.asPlatform(): MapCoreSharedModule.MCLineFactory = nativeHandle as MapCoreSharedModule.MCLineFactory +public fun MapCoreSharedModule.MCLineFactory.asKmp(): KMLineFactory = KMLineFactory(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroup2dInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroup2dInterface.kt new file mode 100644 index 000000000..48e518481 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroup2dInterface.kt @@ -0,0 +1,52 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLineGroup2dInterface", exact = true) +actual interface KMLineGroup2dInterface +{ + + actual fun setLines(lines: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D, is3d: Boolean) + + actual fun asGraphicsObject(): KMGraphicsObjectInterface +} + +private class KMLineGroup2dInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCLineGroup2dInterfaceProtocol) : KMLineGroup2dInterface +{ + + override fun setLines(lines: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D, is3d: Boolean) { + nativeHandle.setLines(lines.asPlatform(), indices.asPlatform(), origin.asPlatform(), is3d) + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol).asKmp() + } +} + +private class KMLineGroup2dInterfacePlatformProxy(private val delegate: KMLineGroup2dInterface) : NSObject(), MapCoreSharedModule.MCLineGroup2dInterfaceProtocol +{ + + override fun setLines(lines: MapCoreSharedModule.MCSharedBytes, indices: MapCoreSharedModule.MCSharedBytes, origin: MapCoreSharedModule.MCVec3D, is3d: Boolean) { + delegate.setLines((lines as MapCoreSharedModule.MCSharedBytes).asKmp(), (indices as MapCoreSharedModule.MCSharedBytes).asKmp(), (origin as MapCoreSharedModule.MCVec3D).asKmp(), is3d) + } + + override fun asGraphicsObject(): MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol? { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } +} + +internal fun KMLineGroup2dInterface.asPlatform(): MapCoreSharedModule.MCLineGroup2dInterfaceProtocol = when (this) { + is KMLineGroup2dInterfacePlatformWrapper -> this.nativeHandle + else -> KMLineGroup2dInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCLineGroup2dInterfaceProtocol.asKmp(): KMLineGroup2dInterface = KMLineGroup2dInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroupShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroupShaderInterface.kt new file mode 100644 index 000000000..8eb6bd989 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineGroupShaderInterface.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLineGroupShaderInterface", exact = true) +actual class KMLineGroupShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCLineGroupShaderInterfaceProtocol + + actual fun setStyles(styles: KMSharedBytes) { + native.setStyles(styles.asPlatform()) + } + + actual fun setDashingScaleFactor(factor: Float) { + native.setDashingScaleFactor(factor) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } +} + +internal fun KMLineGroupShaderInterface.asPlatform(): MapCoreSharedModule.MCLineGroupShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCLineGroupShaderInterfaceProtocol +public fun MapCoreSharedModule.MCLineGroupShaderInterfaceProtocol.asKmp(): KMLineGroupShaderInterface = KMLineGroupShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineInfoInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineInfoInterface.kt new file mode 100644 index 000000000..f726db42c --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineInfoInterface.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLineInfoInterface", exact = true) +actual class KMLineInfoInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCLineInfoInterface + + actual fun getIdentifier(): String { + val result = native.getIdentifier() + return result + } + + actual fun getCoordinates(): ArrayList { + val result = native.getCoordinates() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCCoord).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCCoord).asKmp() })) + } + + actual fun getStyle(): KMLineStyle { + val result = native.getStyle() + return (result as MapCoreSharedModule.MCLineStyle).asKmp() + } +} + +internal fun KMLineInfoInterface.asPlatform(): MapCoreSharedModule.MCLineInfoInterface = nativeHandle as MapCoreSharedModule.MCLineInfoInterface +public fun MapCoreSharedModule.MCLineInfoInterface.asKmp(): KMLineInfoInterface = KMLineInfoInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineJoinType.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineJoinType.kt new file mode 100644 index 000000000..72845383c --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineJoinType.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLineJoinType", exact = true) +actual enum class KMLineJoinType(val rawValue: Long) { + BEVEL(0L), + ROUND(1L), + MITER(2L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCLineJoinType): KMLineJoinType { + val raw: Long = value + return when (raw) { + 0L -> KMLineJoinType.BEVEL + 1L -> KMLineJoinType.ROUND + 2L -> KMLineJoinType.MITER + else -> throw IllegalArgumentException("Unknown KMLineJoinType value: " + raw) + } + } + } +} + +internal fun KMLineJoinType.asPlatform(): MapCoreSharedModule.MCLineJoinType = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerCallbackInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerCallbackInterface.kt new file mode 100644 index 000000000..d52b8d639 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerCallbackInterface.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLineLayerCallbackInterface", exact = true) +actual interface KMLineLayerCallbackInterface +{ + + actual fun onLineClickConfirmed(line: KMLineInfoInterface) +} + +private class KMLineLayerCallbackInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCLineLayerCallbackInterfaceProtocol) : KMLineLayerCallbackInterface +{ + + override fun onLineClickConfirmed(line: KMLineInfoInterface) { + nativeHandle.onLineClickConfirmed(line.asPlatform()) + } +} + +private class KMLineLayerCallbackInterfacePlatformProxy(private val delegate: KMLineLayerCallbackInterface) : NSObject(), MapCoreSharedModule.MCLineLayerCallbackInterfaceProtocol +{ + + override fun onLineClickConfirmed(line: MapCoreSharedModule.MCLineInfoInterface?) { + delegate.onLineClickConfirmed((line as MapCoreSharedModule.MCLineInfoInterface).asKmp()) + } +} + +internal fun KMLineLayerCallbackInterface.asPlatform(): MapCoreSharedModule.MCLineLayerCallbackInterfaceProtocol = when (this) { + is KMLineLayerCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMLineLayerCallbackInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCLineLayerCallbackInterfaceProtocol.asKmp(): KMLineLayerCallbackInterface = KMLineLayerCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerInterface.kt new file mode 100644 index 000000000..9e0876fd0 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineLayerInterface.kt @@ -0,0 +1,80 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLineLayerInterface", exact = true) +actual class KMLineLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCLineLayerInterface + + actual fun setLines(lines: ArrayList) { + native.setLines(ArrayList(lines.map { it.asPlatform() })) + } + + actual fun getLines(): ArrayList { + val result = native.getLines() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCLineInfoInterface).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCLineInfoInterface).asKmp() })) + } + + actual fun remove(line: KMLineInfoInterface) { + native.remove(line.asPlatform()) + } + + actual fun add(line: KMLineInfoInterface) { + native.add(line.asPlatform()) + } + + actual fun clear() { + native.clear() + } + + actual fun setCallbackHandler(handler: KMLineLayerCallbackInterface) { + native.setCallbackHandler(handler.asPlatform()) + } + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as MapCoreSharedModule.MCLayerInterfaceProtocol).asKmp() + } + + actual fun invalidate() { + native.invalidate() + } + + actual fun resetSelection() { + native.resetSelection() + } + + actual fun setSelected(selectedIds: HashSet) { + native.setSelected(HashSet(selectedIds.map { it })) + } + + actual fun setLayerClickable(isLayerClickable: Boolean) { + native.setLayerClickable(isLayerClickable) + } + + actual fun setRenderPassIndex(index: Int) { + native.setRenderPassIndex(index) + } + + actual companion object + { + + actual fun create(): KMLineLayerInterface { + val result = MapCoreSharedModule.MCLineLayerInterface.create() + return (result as MapCoreSharedModule.MCLineLayerInterface).asKmp() + } + } +} + +internal fun KMLineLayerInterface.asPlatform(): MapCoreSharedModule.MCLineLayerInterface = nativeHandle as MapCoreSharedModule.MCLineLayerInterface +public fun MapCoreSharedModule.MCLineLayerInterface.asKmp(): KMLineLayerInterface = KMLineLayerInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineStyle.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineStyle.kt new file mode 100644 index 000000000..4156650f5 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLineStyle.kt @@ -0,0 +1,76 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from line.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLineStyle", exact = true) +actual class KMLineStyle actual public constructor( + color: KMColorStateList, + gapColor: KMColorStateList, + opacity: Float, + blur: Float, + widthType: KMSizeType, + width: Float, + dashArray: ArrayList, + dashFade: Float, + dashAnimationSpeed: Float, + lineCap: KMLineCapType, + lineJoin: KMLineJoinType, + offset: Float, + dotted: Boolean, + dottedSkew: Float, +) { + actual val color: KMColorStateList = color + actual val gapColor: KMColorStateList = gapColor + actual val opacity: Float = opacity + actual val blur: Float = blur + actual val widthType: KMSizeType = widthType + actual val width: Float = width + actual val dashArray: ArrayList = dashArray + actual val dashFade: Float = dashFade + actual val dashAnimationSpeed: Float = dashAnimationSpeed + actual val lineCap: KMLineCapType = lineCap + actual val lineJoin: KMLineJoinType = lineJoin + actual val offset: Float = offset + actual val dotted: Boolean = dotted + actual val dottedSkew: Float = dottedSkew +} + +internal fun KMLineStyle.asPlatform(): MapCoreSharedModule.MCLineStyle = MapCoreSharedModule.MCLineStyle( + color = color.asPlatform(), + gapColor = gapColor.asPlatform(), + opacity = opacity, + blur = blur, + widthType = widthType.asPlatform(), + width = width, + dashArray = ArrayList(dashArray.map { platform.Foundation.NSNumber(float = it) }), + dashFade = dashFade, + dashAnimationSpeed = dashAnimationSpeed, + lineCap = lineCap.asPlatform(), + lineJoin = lineJoin.asPlatform(), + offset = offset, + dotted = dotted, + dottedSkew = dottedSkew, +) +public fun MapCoreSharedModule.MCLineStyle.asKmp(): KMLineStyle = KMLineStyle( + color = (this.color as MapCoreSharedModule.MCColorStateList).asKmp(), + gapColor = (this.gapColor as MapCoreSharedModule.MCColorStateList).asKmp(), + opacity = this.opacity, + blur = this.blur, + widthType = KMSizeType.fromPlatform((this.widthType as MapCoreSharedModule.MCSizeType)), + width = this.width, + dashArray = ArrayList(((this.dashArray as? List<*>)?.map { (it as platform.Foundation.NSNumber).floatValue } ?: (0 until (this.dashArray as platform.Foundation.NSArray).count.toInt()).map { idx -> ((this.dashArray as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as platform.Foundation.NSNumber).floatValue })), + dashFade = this.dashFade, + dashAnimationSpeed = this.dashAnimationSpeed, + lineCap = KMLineCapType.fromPlatform((this.lineCap as MapCoreSharedModule.MCLineCapType)), + lineJoin = KMLineJoinType.fromPlatform((this.lineJoin as MapCoreSharedModule.MCLineJoinType)), + offset = this.offset, + dotted = this.dotted, + dottedSkew = this.dottedSkew, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderInterface.kt new file mode 100644 index 000000000..91950996b --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderInterface.kt @@ -0,0 +1,88 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLoaderInterface", exact = true) +actual interface KMLoaderInterface +{ + + actual fun loadTexture(url: String, etag: String?): KMTextureLoaderResult + + actual fun loadData(url: String, etag: String?): KMDataLoaderResult + + actual fun loadTextureAsync(url: String, etag: String?): KMFuture + + actual fun loadDataAsync(url: String, etag: String?): KMFuture + + actual fun cancel(url: String) +} + +private class KMLoaderInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCLoaderInterfaceProtocol) : KMLoaderInterface +{ + + override fun loadTexture(url: String, etag: String?): KMTextureLoaderResult { + val result = nativeHandle.loadTexture(url, etag?.let { it }) + return (result as MapCoreSharedModule.MCTextureLoaderResult).asKmp() + } + + override fun loadData(url: String, etag: String?): KMDataLoaderResult { + val result = nativeHandle.loadData(url, etag?.let { it }) + return (result as MapCoreSharedModule.MCDataLoaderResult).asKmp() + } + + override fun loadTextureAsync(url: String, etag: String?): KMFuture { + val result = nativeHandle.loadTextureAsync(url, etag?.let { it }) + return (result as MapCoreSharedModule.DJFuture).asKmp() + } + + override fun loadDataAsync(url: String, etag: String?): KMFuture { + val result = nativeHandle.loadDataAsync(url, etag?.let { it }) + return (result as MapCoreSharedModule.DJFuture).asKmp() + } + + override fun cancel(url: String) { + nativeHandle.cancel(url) + } +} + +private class KMLoaderInterfacePlatformProxy(private val delegate: KMLoaderInterface) : NSObject(), MapCoreSharedModule.MCLoaderInterfaceProtocol +{ + + override fun loadTexture(url: String, etag: String?): MapCoreSharedModule.MCTextureLoaderResult { + val result = delegate.loadTexture(url, etag?.let { (it as String) }) + return result.asPlatform() + } + + override fun loadData(url: String, etag: String?): MapCoreSharedModule.MCDataLoaderResult { + val result = delegate.loadData(url, etag?.let { (it as String) }) + return result.asPlatform() + } + + override fun loadTextureAsync(url: String, etag: String?): MapCoreSharedModule.DJFuture { + val result = delegate.loadTextureAsync(url, etag?.let { (it as String) }) + return result.asPlatform() + } + + override fun loadDataAsync(url: String, etag: String?): MapCoreSharedModule.DJFuture { + val result = delegate.loadDataAsync(url, etag?.let { (it as String) }) + return result.asPlatform() + } + + override fun cancel(url: String) { + delegate.cancel(url) + } +} + +internal fun KMLoaderInterface.asPlatform(): MapCoreSharedModule.MCLoaderInterfaceProtocol = when (this) { + is KMLoaderInterfacePlatformWrapper -> this.nativeHandle + else -> KMLoaderInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCLoaderInterfaceProtocol.asKmp(): KMLoaderInterface = KMLoaderInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderStatus.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderStatus.kt new file mode 100644 index 000000000..f4aa29aaa --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoaderStatus.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLoaderStatus", exact = true) +actual enum class KMLoaderStatus(val rawValue: Long) { + OK(0L), + NOOP(1L), + ERROR_TIMEOUT(2L), + ERROR_NETWORK(3L), + ERROR_OTHER(4L), + ERROR_400(5L), + ERROR_404(6L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCLoaderStatus): KMLoaderStatus { + val raw: Long = value + return when (raw) { + 0L -> KMLoaderStatus.OK + 1L -> KMLoaderStatus.NOOP + 2L -> KMLoaderStatus.ERROR_TIMEOUT + 3L -> KMLoaderStatus.ERROR_NETWORK + 4L -> KMLoaderStatus.ERROR_OTHER + 5L -> KMLoaderStatus.ERROR_400 + 6L -> KMLoaderStatus.ERROR_404 + else -> throw IllegalArgumentException("Unknown KMLoaderStatus value: " + raw) + } + } + } +} + +internal fun KMLoaderStatus.asPlatform(): MapCoreSharedModule.MCLoaderStatus = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoggerData.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoggerData.kt new file mode 100644 index 000000000..cdeaaa6c2 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMLoggerData.kt @@ -0,0 +1,56 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMLoggerData", exact = true) +actual class KMLoggerData actual public constructor( + id: String, + buckets: ArrayList, + bucketSizeMs: Int, + start: Long, + end: Long, + numSamples: Long, + average: Double, + variance: Double, + stdDeviation: Double, +) { + actual val id: String = id + actual val buckets: ArrayList = buckets + actual val bucketSizeMs: Int = bucketSizeMs + actual val start: Long = start + actual val end: Long = end + actual val numSamples: Long = numSamples + actual val average: Double = average + actual val variance: Double = variance + actual val stdDeviation: Double = stdDeviation +} + +internal fun KMLoggerData.asPlatform(): MapCoreSharedModule.MCLoggerData = MapCoreSharedModule.MCLoggerData( + id = id, + buckets = ArrayList(buckets.map { platform.Foundation.NSNumber(longLong = it) }), + bucketSizeMs = bucketSizeMs, + start = start, + end = end, + numSamples = numSamples, + average = average, + variance = variance, + stdDeviation = stdDeviation, +) +public fun MapCoreSharedModule.MCLoggerData.asKmp(): KMLoggerData = KMLoggerData( + id = this.id, + buckets = ArrayList(((this.buckets as? List<*>)?.map { (it as platform.Foundation.NSNumber).longLongValue } ?: (0 until (this.buckets as platform.Foundation.NSArray).count.toInt()).map { idx -> ((this.buckets as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as platform.Foundation.NSNumber).longLongValue })), + bucketSizeMs = this.bucketSizeMs, + start = this.start, + end = this.end, + numSamples = this.numSamples, + average = this.average, + variance = this.variance, + stdDeviation = this.stdDeviation, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCallbackInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCallbackInterface.kt new file mode 100644 index 000000000..c807c9342 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCallbackInterface.kt @@ -0,0 +1,50 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMMapCallbackInterface", exact = true) +actual interface KMMapCallbackInterface +{ + + actual fun invalidate() + + actual fun onMapResumed() +} + +private class KMMapCallbackInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCMapCallbackInterfaceProtocol) : KMMapCallbackInterface +{ + + override fun invalidate() { + nativeHandle.invalidate() + } + + override fun onMapResumed() { + nativeHandle.onMapResumed() + } +} + +private class KMMapCallbackInterfacePlatformProxy(private val delegate: KMMapCallbackInterface) : NSObject(), MapCoreSharedModule.MCMapCallbackInterfaceProtocol +{ + + override fun invalidate() { + delegate.invalidate() + } + + override fun onMapResumed() { + delegate.onMapResumed() + } +} + +internal fun KMMapCallbackInterface.asPlatform(): MapCoreSharedModule.MCMapCallbackInterfaceProtocol = when (this) { + is KMMapCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMMapCallbackInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCMapCallbackInterfaceProtocol.asKmp(): KMMapCallbackInterface = KMMapCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCamera3dInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCamera3dInterface.kt new file mode 100644 index 000000000..06b6ed67f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCamera3dInterface.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMMapCamera3dInterface", exact = true) +actual class KMMapCamera3dInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCMapCamera3dInterface + + actual fun getCameraConfig(): KMCamera3dConfig { + val result = native.getCameraConfig() + return (result as MapCoreSharedModule.MCCamera3dConfig).asKmp() + } + + actual fun setCameraConfig(config: KMCamera3dConfig, durationSeconds: Float?, targetZoom: Float?, targetCoordinate: KMCoord?) { + native.setCameraConfig(config.asPlatform(), durationSeconds?.let { platform.Foundation.NSNumber(float = it) }, targetZoom?.let { platform.Foundation.NSNumber(float = it) }, targetCoordinate?.let { it.asPlatform() }) + } +} + +internal fun KMMapCamera3dInterface.asPlatform(): MapCoreSharedModule.MCMapCamera3dInterface = nativeHandle as MapCoreSharedModule.MCMapCamera3dInterface +public fun MapCoreSharedModule.MCMapCamera3dInterface.asKmp(): KMMapCamera3dInterface = KMMapCamera3dInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraInterface.kt new file mode 100644 index 000000000..f9af8783c --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraInterface.kt @@ -0,0 +1,245 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMMapCameraInterface", exact = true) +actual class KMMapCameraInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCMapCameraInterface + + actual fun freeze(freeze: Boolean) { + native.freeze(freeze) + } + + actual fun moveToCenterPositionZoom(centerPosition: KMCoord, zoom: Double, animated: Boolean) { + native.moveToCenterPositionZoom(centerPosition.asPlatform(), zoom, animated) + } + + actual fun moveToCenterPosition(centerPosition: KMCoord, animated: Boolean) { + native.moveToCenterPosition(centerPosition.asPlatform(), animated) + } + + actual fun moveToBoundingBox(boundingBox: KMRectCoord, paddingPc: Float, animated: Boolean, minZoom: Double?, maxZoom: Double?) { + native.moveToBoundingBox(boundingBox.asPlatform(), paddingPc, animated, minZoom?.let { platform.Foundation.NSNumber(double = it) }, maxZoom?.let { platform.Foundation.NSNumber(double = it) }) + } + + actual fun getCenterPosition(): KMCoord { + val result = native.getCenterPosition() + return (result as MapCoreSharedModule.MCCoord).asKmp() + } + + actual fun setZoom(zoom: Double, animated: Boolean) { + native.setZoom(zoom, animated) + } + + actual fun getZoom(): Double { + val result = native.getZoom() + return result + } + + actual fun setRotation(angle: Float, animated: Boolean) { + native.setRotation(angle, animated) + } + + actual fun getRotation(): Float { + val result = native.getRotation() + return result + } + + actual fun setMinZoom(minZoom: Double) { + native.setMinZoom(minZoom) + } + + actual fun setMaxZoom(maxZoom: Double) { + native.setMaxZoom(maxZoom) + } + + actual fun getMinZoom(): Double { + val result = native.getMinZoom() + return result + } + + actual fun getMaxZoom(): Double { + val result = native.getMaxZoom() + return result + } + + actual fun setBounds(bounds: KMRectCoord) { + native.setBounds(bounds.asPlatform()) + } + + actual fun getBounds(): KMRectCoord { + val result = native.getBounds() + return (result as MapCoreSharedModule.MCRectCoord).asKmp() + } + + actual fun isInBounds(coords: KMCoord): Boolean { + val result = native.isInBounds(coords.asPlatform()) + return result + } + + actual fun setPaddingLeft(padding: Float) { + native.setPaddingLeft(padding) + } + + actual fun setPaddingRight(padding: Float) { + native.setPaddingRight(padding) + } + + actual fun setPaddingTop(padding: Float) { + native.setPaddingTop(padding) + } + + actual fun setPaddingBottom(padding: Float) { + native.setPaddingBottom(padding) + } + + actual fun getVisibleRect(): KMRectCoord { + val result = native.getVisibleRect() + return (result as MapCoreSharedModule.MCRectCoord).asKmp() + } + + actual fun getPaddingAdjustedVisibleRect(): KMRectCoord { + val result = native.getPaddingAdjustedVisibleRect() + return (result as MapCoreSharedModule.MCRectCoord).asKmp() + } + + actual fun getScreenDensityPpi(): Float { + val result = native.getScreenDensityPpi() + return result + } + + actual fun update() { + native.update() + } + + actual fun getInvariantModelMatrix(coordinate: KMCoord, scaleInvariant: Boolean, rotationInvariant: Boolean): ArrayList { + val result = native.getInvariantModelMatrix(coordinate.asPlatform(), scaleInvariant, rotationInvariant) + return ArrayList(((result as? List<*>)?.map { (it as platform.Foundation.NSNumber).floatValue } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as platform.Foundation.NSNumber).floatValue })) + } + + actual fun addListener(listener: KMMapCameraListenerInterface) { + native.addListener(listener.asPlatform()) + } + + actual fun removeListener(listener: KMMapCameraListenerInterface) { + native.removeListener(listener.asPlatform()) + } + + actual fun notifyListenerBoundsChange() { + native.notifyListenerBoundsChange() + } + + actual fun coordFromScreenPosition(posScreen: KMVec2F): KMCoord { + val result = native.coordFromScreenPosition(posScreen.asPlatform()) + return (result as MapCoreSharedModule.MCCoord).asKmp() + } + + actual fun coordFromScreenPositionZoom(posScreen: KMVec2F, zoom: Float): KMCoord { + val result = native.coordFromScreenPositionZoom(posScreen.asPlatform(), zoom) + return (result as MapCoreSharedModule.MCCoord).asKmp() + } + + actual fun screenPosFromCoord(coord: KMCoord): KMVec2F { + val result = native.screenPosFromCoord(coord.asPlatform()) + return (result as MapCoreSharedModule.MCVec2F).asKmp() + } + + actual fun screenPosFromCoordZoom(coord: KMCoord, zoom: Float): KMVec2F { + val result = native.screenPosFromCoordZoom(coord.asPlatform(), zoom) + return (result as MapCoreSharedModule.MCVec2F).asKmp() + } + + actual fun mapUnitsFromPixels(distancePx: Double): Double { + val result = native.mapUnitsFromPixels(distancePx) + return result + } + + actual fun getScalingFactor(): Double { + val result = native.getScalingFactor() + return result + } + + actual fun coordIsVisibleOnScreen(coord: KMCoord, paddingPc: Float): Boolean { + val result = native.coordIsVisibleOnScreen(coord.asPlatform(), paddingPc) + return result + } + + actual fun setRotationEnabled(enabled: Boolean) { + native.setRotationEnabled(enabled) + } + + actual fun setSnapToNorthEnabled(enabled: Boolean) { + native.setSnapToNorthEnabled(enabled) + } + + actual fun setBoundsRestrictWholeVisibleRect(enabled: Boolean) { + native.setBoundsRestrictWholeVisibleRect(enabled) + } + + actual fun asCameraInterface(): KMCameraInterface { + val result = native.asCameraInterface() + return (result as MapCoreSharedModule.MCCameraInterfaceProtocol).asKmp() + } + + actual fun getLastVpMatrixD(): ArrayList? { + val result = native.getLastVpMatrixD() + return result?.let { ArrayList(((it as? List<*>)?.map { (it as platform.Foundation.NSNumber).doubleValue } ?: (0 until (it as platform.Foundation.NSArray).count.toInt()).map { idx -> ((it as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as platform.Foundation.NSNumber).doubleValue })) } + } + + actual fun getLastVpMatrix(): ArrayList? { + val result = native.getLastVpMatrix() + return result?.let { ArrayList(((it as? List<*>)?.map { (it as platform.Foundation.NSNumber).floatValue } ?: (0 until (it as platform.Foundation.NSArray).count.toInt()).map { idx -> ((it as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as platform.Foundation.NSNumber).floatValue })) } + } + + actual fun getLastInverseVpMatrix(): ArrayList? { + val result = native.getLastInverseVpMatrix() + return result?.let { ArrayList(((it as? List<*>)?.map { (it as platform.Foundation.NSNumber).floatValue } ?: (0 until (it as platform.Foundation.NSArray).count.toInt()).map { idx -> ((it as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as platform.Foundation.NSNumber).floatValue })) } + } + + actual fun getLastVpMatrixViewBounds(): KMRectCoord? { + val result = native.getLastVpMatrixViewBounds() + return result?.let { (it as MapCoreSharedModule.MCRectCoord).asKmp() } + } + + actual fun getLastVpMatrixRotation(): Float? { + val result = native.getLastVpMatrixRotation() + return result?.let { (it as platform.Foundation.NSNumber).floatValue } + } + + actual fun getLastVpMatrixZoom(): Float? { + val result = native.getLastVpMatrixZoom() + return result?.let { (it as platform.Foundation.NSNumber).floatValue } + } + + actual fun getLastCameraPosition(): KMVec3D? { + val result = native.getLastCameraPosition() + return result?.let { (it as MapCoreSharedModule.MCVec3D).asKmp() } + } + + actual fun asMapCamera3d(): KMMapCamera3dInterface? { + val result = native.asMapCamera3d() + return result?.let { (it as MapCoreSharedModule.MCMapCamera3dInterface).asKmp() } + } + + actual companion object + { + + actual fun create(mapInterface: KMMapInterface, screenDensityPpi: Float, is3D: Boolean): KMMapCameraInterface { + val result = MapCoreSharedModule.MCMapCameraInterface.create(mapInterface.asPlatform(), screenDensityPpi, is3D) + return (result as MapCoreSharedModule.MCMapCameraInterface).asKmp() + } + } +} + +internal fun KMMapCameraInterface.asPlatform(): MapCoreSharedModule.MCMapCameraInterface = nativeHandle as MapCoreSharedModule.MCMapCameraInterface +public fun MapCoreSharedModule.MCMapCameraInterface.asKmp(): KMMapCameraInterface = KMMapCameraInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraListenerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraListenerInterface.kt new file mode 100644 index 000000000..51754fafe --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCameraListenerInterface.kt @@ -0,0 +1,70 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from camera.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMMapCameraListenerInterface", exact = true) +actual interface KMMapCameraListenerInterface +{ + + actual fun onVisibleBoundsChanged(visibleBounds: KMRectCoord, zoom: Double) + + actual fun onRotationChanged(angle: Float) + + actual fun onMapInteraction() + + actual fun onCameraChange(viewMatrix: ArrayList, projectionMatrix: ArrayList, origin: KMVec3D, verticalFov: Float, horizontalFov: Float, width: Float, height: Float, focusPointAltitude: Float, focusPointPosition: KMCoord, zoom: Float) +} + +private class KMMapCameraListenerInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCMapCameraListenerInterfaceProtocol) : KMMapCameraListenerInterface +{ + + override fun onVisibleBoundsChanged(visibleBounds: KMRectCoord, zoom: Double) { + nativeHandle.onVisibleBoundsChanged(visibleBounds.asPlatform(), zoom) + } + + override fun onRotationChanged(angle: Float) { + nativeHandle.onRotationChanged(angle) + } + + override fun onMapInteraction() { + nativeHandle.onMapInteraction() + } + + override fun onCameraChange(viewMatrix: ArrayList, projectionMatrix: ArrayList, origin: KMVec3D, verticalFov: Float, horizontalFov: Float, width: Float, height: Float, focusPointAltitude: Float, focusPointPosition: KMCoord, zoom: Float) { + nativeHandle.onCameraChange(ArrayList(viewMatrix.map { platform.Foundation.NSNumber(float = it) }), ArrayList(projectionMatrix.map { platform.Foundation.NSNumber(float = it) }), origin.asPlatform(), verticalFov, horizontalFov, width, height, focusPointAltitude, focusPointPosition.asPlatform(), zoom) + } +} + +private class KMMapCameraListenerInterfacePlatformProxy(private val delegate: KMMapCameraListenerInterface) : NSObject(), MapCoreSharedModule.MCMapCameraListenerInterfaceProtocol +{ + + override fun onVisibleBoundsChanged(visibleBounds: MapCoreSharedModule.MCRectCoord, zoom: Double) { + delegate.onVisibleBoundsChanged((visibleBounds as MapCoreSharedModule.MCRectCoord).asKmp(), zoom) + } + + override fun onRotationChanged(angle: Float) { + delegate.onRotationChanged(angle) + } + + override fun onMapInteraction() { + delegate.onMapInteraction() + } + + override fun onCameraChange(viewMatrix: List<*>, projectionMatrix: List<*>, origin: MapCoreSharedModule.MCVec3D, verticalFov: Float, horizontalFov: Float, width: Float, height: Float, focusPointAltitude: Float, focusPointPosition: MapCoreSharedModule.MCCoord, zoom: Float) { + delegate.onCameraChange(ArrayList(((viewMatrix as? List<*>)?.map { (it as platform.Foundation.NSNumber).floatValue } ?: (0 until (viewMatrix as platform.Foundation.NSArray).count.toInt()).map { idx -> ((viewMatrix as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as platform.Foundation.NSNumber).floatValue })), ArrayList(((projectionMatrix as? List<*>)?.map { (it as platform.Foundation.NSNumber).floatValue } ?: (0 until (projectionMatrix as platform.Foundation.NSArray).count.toInt()).map { idx -> ((projectionMatrix as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as platform.Foundation.NSNumber).floatValue })), (origin as MapCoreSharedModule.MCVec3D).asKmp(), verticalFov, horizontalFov, width, height, focusPointAltitude, (focusPointPosition as MapCoreSharedModule.MCCoord).asKmp(), zoom) + } +} + +internal fun KMMapCameraListenerInterface.asPlatform(): MapCoreSharedModule.MCMapCameraListenerInterfaceProtocol = when (this) { + is KMMapCameraListenerInterfacePlatformWrapper -> this.nativeHandle + else -> KMMapCameraListenerInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCMapCameraListenerInterfaceProtocol.asKmp(): KMMapCameraListenerInterface = KMMapCameraListenerInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapConfig.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapConfig.kt new file mode 100644 index 000000000..2bc005fe7 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapConfig.kt @@ -0,0 +1,24 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMMapConfig", exact = true) +actual class KMMapConfig actual public constructor( + mapCoordinateSystem: KMMapCoordinateSystem, +) { + actual val mapCoordinateSystem: KMMapCoordinateSystem = mapCoordinateSystem +} + +internal fun KMMapConfig.asPlatform(): MapCoreSharedModule.MCMapConfig = MapCoreSharedModule.MCMapConfig( + mapCoordinateSystem = mapCoordinateSystem.asPlatform(), +) +public fun MapCoreSharedModule.MCMapConfig.asKmp(): KMMapConfig = KMMapConfig( + mapCoordinateSystem = (this.mapCoordinateSystem as MapCoreSharedModule.MCMapCoordinateSystem).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCoordinateSystem.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCoordinateSystem.kt new file mode 100644 index 000000000..4ddac6d45 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapCoordinateSystem.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMMapCoordinateSystem", exact = true) +actual class KMMapCoordinateSystem actual public constructor( + identifier: Int, + bounds: KMRectCoord, + unitToScreenMeterFactor: Float, +) { + actual val identifier: Int = identifier + actual val bounds: KMRectCoord = bounds + actual val unitToScreenMeterFactor: Float = unitToScreenMeterFactor +} + +internal fun KMMapCoordinateSystem.asPlatform(): MapCoreSharedModule.MCMapCoordinateSystem = MapCoreSharedModule.MCMapCoordinateSystem( + identifier = identifier, + bounds = bounds.asPlatform(), + unitToScreenMeterFactor = unitToScreenMeterFactor, +) +public fun MapCoreSharedModule.MCMapCoordinateSystem.asKmp(): KMMapCoordinateSystem = KMMapCoordinateSystem( + identifier = this.identifier, + bounds = (this.bounds as MapCoreSharedModule.MCRectCoord).asKmp(), + unitToScreenMeterFactor = this.unitToScreenMeterFactor, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterface.kt new file mode 100644 index 000000000..a02fe3334 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterface.kt @@ -0,0 +1,188 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMMapInterface", exact = true) +actual class KMMapInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCMapInterface + + actual fun setCallbackHandler(callbackInterface: KMMapCallbackInterface?) { + native.setCallbackHandler(callbackInterface?.let { it.asPlatform() }) + } + + actual fun getGraphicsObjectFactory(): KMGraphicsObjectFactoryInterface { + val result = native.getGraphicsObjectFactory() + return (result as MapCoreSharedModule.MCGraphicsObjectFactoryInterfaceProtocol).asKmp() + } + + actual fun getShaderFactory(): KMShaderFactoryInterface { + val result = native.getShaderFactory() + return (result as MapCoreSharedModule.MCShaderFactoryInterfaceProtocol).asKmp() + } + + actual fun getScheduler(): KMSchedulerInterface { + val result = native.getScheduler() + return (result as MapCoreSharedModule.MCSchedulerInterfaceProtocol).asKmp() + } + + actual fun getRenderingContext(): KMRenderingContextInterface { + val result = native.getRenderingContext() + return (result as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp() + } + + actual fun getMapConfig(): KMMapConfig { + val result = native.getMapConfig() + return (result as MapCoreSharedModule.MCMapConfig).asKmp() + } + + actual fun getCoordinateConverterHelper(): KMCoordinateConversionHelperInterface { + val result = native.getCoordinateConverterHelper() + return (result as MapCoreSharedModule.MCCoordinateConversionHelperInterface).asKmp() + } + + actual fun setCamera(camera: KMMapCameraInterface) { + native.setCamera(camera.asPlatform()) + } + + actual fun getCamera(): KMMapCameraInterface { + val result = native.getCamera() + return (result as MapCoreSharedModule.MCMapCameraInterface).asKmp() + } + + actual fun setTouchHandler(touchHandler: KMTouchHandlerInterface) { + native.setTouchHandler(touchHandler.asPlatform()) + } + + actual fun getTouchHandler(): KMTouchHandlerInterface { + val result = native.getTouchHandler() + return (result as MapCoreSharedModule.MCTouchHandlerInterfaceProtocol).asKmp() + } + + actual fun setPerformanceLoggers(performanceLoggers: ArrayList) { + native.setPerformanceLoggers(ArrayList(performanceLoggers.map { it.asPlatform() })) + } + + actual fun getPerformanceLoggers(): ArrayList { + val result = native.getPerformanceLoggers() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCPerformanceLoggerInterfaceProtocol).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCPerformanceLoggerInterfaceProtocol).asKmp() })) + } + + actual fun getLayers(): ArrayList { + val result = native.getLayers() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCLayerInterfaceProtocol).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCLayerInterfaceProtocol).asKmp() })) + } + + actual fun getLayersIndexed(): ArrayList { + val result = native.getLayersIndexed() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCIndexedLayerInterfaceProtocol).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCIndexedLayerInterfaceProtocol).asKmp() })) + } + + actual fun addLayer(layer: KMLayerInterface) { + native.addLayer(layer.asPlatform()) + } + + actual fun insertLayerAt(layer: KMLayerInterface, atIndex: Int) { + native.insertLayerAt(layer.asPlatform(), atIndex) + } + + actual fun insertLayerAbove(layer: KMLayerInterface, above: KMLayerInterface) { + native.insertLayerAbove(layer.asPlatform(), above.asPlatform()) + } + + actual fun insertLayerBelow(layer: KMLayerInterface, below: KMLayerInterface) { + native.insertLayerBelow(layer.asPlatform(), below.asPlatform()) + } + + actual fun removeLayer(layer: KMLayerInterface) { + native.removeLayer(layer.asPlatform()) + } + + actual fun setViewportSize(size: KMVec2I) { + native.setViewportSize(size.asPlatform()) + } + + actual fun setBackgroundColor(color: KMColor) { + native.setBackgroundColor(color.asPlatform()) + } + + actual fun is3d(): Boolean { + val result = native.is3d() + return result + } + + actual fun invalidate() { + native.invalidate() + } + + actual fun resetIsInvalidated() { + native.resetIsInvalidated() + } + + actual fun prepare() { + native.prepare() + } + + actual fun getNeedsCompute(): Boolean { + val result = native.getNeedsCompute() + return result + } + + actual fun drawOffscreenFrame(target: KMRenderTargetInterface) { + native.drawOffscreenFrame(target.asPlatform()) + } + + actual fun drawFrame() { + native.drawFrame() + } + + actual fun compute() { + native.compute() + } + + actual fun resume() { + native.resume() + } + + actual fun pause() { + native.pause() + } + + actual fun destroy() { + native.destroy() + } + + actual fun drawReadyFrame(bounds: KMRectCoord, paddingPc: Float, timeout: Float, callbacks: KMMapReadyCallbackInterface) { + native.drawReadyFrame(bounds.asPlatform(), paddingPc, timeout, callbacks.asPlatform()) + } + + actual fun forceReload() { + native.forceReload() + } + + actual companion object + { + + actual fun create(graphicsFactory: KMGraphicsObjectFactoryInterface, shaderFactory: KMShaderFactoryInterface, renderingContext: KMRenderingContextInterface, mapConfig: KMMapConfig, scheduler: KMSchedulerInterface, pixelDensity: Float, is3D: Boolean): KMMapInterface { + val result = MapCoreSharedModule.MCMapInterface.create(graphicsFactory.asPlatform(), shaderFactory.asPlatform(), renderingContext.asPlatform(), mapConfig.asPlatform(), scheduler.asPlatform(), pixelDensity, is3D) + return (result as MapCoreSharedModule.MCMapInterface).asKmp() + } + + actual fun createWithOpenGl(mapConfig: KMMapConfig, scheduler: KMSchedulerInterface, pixelDensity: Float, is3D: Boolean): KMMapInterface { + val result = MapCoreSharedModule.MCMapInterface.createWithOpenGl(mapConfig.asPlatform(), scheduler.asPlatform(), pixelDensity, is3D) + return (result as MapCoreSharedModule.MCMapInterface).asKmp() + } + } +} + +internal fun KMMapInterface.asPlatform(): MapCoreSharedModule.MCMapInterface = nativeHandle as MapCoreSharedModule.MCMapInterface +public fun MapCoreSharedModule.MCMapInterface.asKmp(): KMMapInterface = KMMapInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapReadyCallbackInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapReadyCallbackInterface.kt new file mode 100644 index 000000000..19675778f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapReadyCallbackInterface.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMMapReadyCallbackInterface", exact = true) +actual interface KMMapReadyCallbackInterface +{ + + actual fun stateDidUpdate(state: KMLayerReadyState) +} + +private class KMMapReadyCallbackInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCMapReadyCallbackInterfaceProtocol) : KMMapReadyCallbackInterface +{ + + override fun stateDidUpdate(state: KMLayerReadyState) { + nativeHandle.stateDidUpdate(state.asPlatform()) + } +} + +private class KMMapReadyCallbackInterfacePlatformProxy(private val delegate: KMMapReadyCallbackInterface) : NSObject(), MapCoreSharedModule.MCMapReadyCallbackInterfaceProtocol +{ + + override fun stateDidUpdate(state: MapCoreSharedModule.MCLayerReadyState) { + delegate.stateDidUpdate(KMLayerReadyState.fromPlatform((state as MapCoreSharedModule.MCLayerReadyState))) + } +} + +internal fun KMMapReadyCallbackInterface.asPlatform(): MapCoreSharedModule.MCMapReadyCallbackInterfaceProtocol = when (this) { + is KMMapReadyCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMMapReadyCallbackInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCMapReadyCallbackInterfaceProtocol.asKmp(): KMMapReadyCallbackInterface = KMMapReadyCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapsCoreSharedModule.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapsCoreSharedModule.kt new file mode 100644 index 000000000..bffa0e78c --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapsCoreSharedModule.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from maps_core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMMapsCoreSharedModule", exact = true) +actual class KMMapsCoreSharedModule actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCMapsCoreSharedModule + + actual companion object + { + + actual fun version(): String { + val result = MapCoreSharedModule.MCMapsCoreSharedModule.version() + return result + } + } +} + +internal fun KMMapsCoreSharedModule.asPlatform(): MapCoreSharedModule.MCMapsCoreSharedModule = nativeHandle as MapCoreSharedModule.MCMapsCoreSharedModule +public fun MapCoreSharedModule.MCMapsCoreSharedModule.asKmp(): KMMapsCoreSharedModule = KMMapsCoreSharedModule(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMaskingObjectInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMaskingObjectInterface.kt new file mode 100644 index 000000000..ad41d4910 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMaskingObjectInterface.kt @@ -0,0 +1,52 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMMaskingObjectInterface", exact = true) +actual interface KMMaskingObjectInterface +{ + + actual fun asGraphicsObject(): KMGraphicsObjectInterface + + actual fun renderAsMask(context: KMRenderingContextInterface, renderPass: KMRenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) +} + +private class KMMaskingObjectInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCMaskingObjectInterfaceProtocol) : KMMaskingObjectInterface +{ + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol).asKmp() + } + + override fun renderAsMask(context: KMRenderingContextInterface, renderPass: KMRenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) { + nativeHandle.renderAsMask(context.asPlatform(), renderPass.asPlatform(), vpMatrix, mMatrix, origin.asPlatform(), screenPixelAsRealMeterFactor, isScreenSpaceCoords) + } +} + +private class KMMaskingObjectInterfacePlatformProxy(private val delegate: KMMaskingObjectInterface) : NSObject(), MapCoreSharedModule.MCMaskingObjectInterfaceProtocol +{ + + override fun asGraphicsObject(): MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol? { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } + + override fun renderAsMask(context: MapCoreSharedModule.MCRenderingContextInterfaceProtocol?, renderPass: MapCoreSharedModule.MCRenderPassConfig, vpMatrix: Long, mMatrix: Long, origin: MapCoreSharedModule.MCVec3D, screenPixelAsRealMeterFactor: Double, isScreenSpaceCoords: Boolean) { + delegate.renderAsMask((context as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp(), (renderPass as MapCoreSharedModule.MCRenderPassConfig).asKmp(), vpMatrix, mMatrix, (origin as MapCoreSharedModule.MCVec3D).asKmp(), screenPixelAsRealMeterFactor, isScreenSpaceCoords) + } +} + +internal fun KMMaskingObjectInterface.asPlatform(): MapCoreSharedModule.MCMaskingObjectInterfaceProtocol = when (this) { + is KMMaskingObjectInterfacePlatformWrapper -> this.nativeHandle + else -> KMMaskingObjectInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCMaskingObjectInterfaceProtocol.asKmp(): KMMaskingObjectInterface = KMMaskingObjectInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlPerformanceLoggerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlPerformanceLoggerInterface.kt new file mode 100644 index 000000000..9ba521f8f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlPerformanceLoggerInterface.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMOpenGlPerformanceLoggerInterface", exact = true) +actual class KMOpenGlPerformanceLoggerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCOpenGlPerformanceLoggerInterface + + actual fun asPerformanceLoggerInterface(): KMPerformanceLoggerInterface { + val result = native.asPerformanceLoggerInterface() + return (result as MapCoreSharedModule.MCPerformanceLoggerInterfaceProtocol).asKmp() + } + + actual companion object + { + + actual fun create(): KMOpenGlPerformanceLoggerInterface { + val result = MapCoreSharedModule.MCOpenGlPerformanceLoggerInterface.create() + return (result as MapCoreSharedModule.MCOpenGlPerformanceLoggerInterface).asKmp() + } + + actual fun createSpecifically(numBuckets: Int, bucketSizeMs: Long): KMOpenGlPerformanceLoggerInterface { + val result = MapCoreSharedModule.MCOpenGlPerformanceLoggerInterface.createSpecifically(numBuckets, bucketSizeMs) + return (result as MapCoreSharedModule.MCOpenGlPerformanceLoggerInterface).asKmp() + } + } +} + +internal fun KMOpenGlPerformanceLoggerInterface.asPlatform(): MapCoreSharedModule.MCOpenGlPerformanceLoggerInterface = nativeHandle as MapCoreSharedModule.MCOpenGlPerformanceLoggerInterface +public fun MapCoreSharedModule.MCOpenGlPerformanceLoggerInterface.asKmp(): KMOpenGlPerformanceLoggerInterface = KMOpenGlPerformanceLoggerInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderTargetInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderTargetInterface.kt new file mode 100644 index 000000000..de4c108a8 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderTargetInterface.kt @@ -0,0 +1,94 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMOpenGlRenderTargetInterface", exact = true) +actual interface KMOpenGlRenderTargetInterface +{ + + actual fun asRenderTargetInterface(): KMRenderTargetInterface + + actual fun setup(size: KMVec2I) + + actual fun clear() + + actual fun bindFramebuffer(renderingContext: KMRenderingContextInterface) + + actual fun unbindFramebuffer() + + actual fun getTextureId(): Int +} + +private class KMOpenGlRenderTargetInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCOpenGlRenderTargetInterfaceProtocol) : KMOpenGlRenderTargetInterface +{ + + override fun asRenderTargetInterface(): KMRenderTargetInterface { + val result = nativeHandle.asRenderTargetInterface() + return (result as MapCoreSharedModule.MCRenderTargetInterfaceProtocol).asKmp() + } + + override fun setup(size: KMVec2I) { + nativeHandle.setup(size.asPlatform()) + } + + override fun clear() { + nativeHandle.clear() + } + + override fun bindFramebuffer(renderingContext: KMRenderingContextInterface) { + nativeHandle.bindFramebuffer(renderingContext.asPlatform()) + } + + override fun unbindFramebuffer() { + nativeHandle.unbindFramebuffer() + } + + override fun getTextureId(): Int { + val result = nativeHandle.getTextureId() + return result + } +} + +private class KMOpenGlRenderTargetInterfacePlatformProxy(private val delegate: KMOpenGlRenderTargetInterface) : NSObject(), MapCoreSharedModule.MCOpenGlRenderTargetInterfaceProtocol +{ + + override fun asRenderTargetInterface(): MapCoreSharedModule.MCRenderTargetInterfaceProtocol? { + val result = delegate.asRenderTargetInterface() + return result.asPlatform() + } + + override fun setup(size: MapCoreSharedModule.MCVec2I) { + delegate.setup((size as MapCoreSharedModule.MCVec2I).asKmp()) + } + + override fun clear() { + delegate.clear() + } + + override fun bindFramebuffer(renderingContext: MapCoreSharedModule.MCRenderingContextInterfaceProtocol?) { + delegate.bindFramebuffer((renderingContext as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp()) + } + + override fun unbindFramebuffer() { + delegate.unbindFramebuffer() + } + + override fun getTextureId(): Int { + val result = delegate.getTextureId() + return result + } +} + +internal fun KMOpenGlRenderTargetInterface.asPlatform(): MapCoreSharedModule.MCOpenGlRenderTargetInterfaceProtocol = when (this) { + is KMOpenGlRenderTargetInterfacePlatformWrapper -> this.nativeHandle + else -> KMOpenGlRenderTargetInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCOpenGlRenderTargetInterfaceProtocol.asKmp(): KMOpenGlRenderTargetInterface = KMOpenGlRenderTargetInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderingContextInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderingContextInterface.kt new file mode 100644 index 000000000..c5fe3c6f1 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMOpenGlRenderingContextInterface.kt @@ -0,0 +1,130 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMOpenGlRenderingContextInterface", exact = true) +actual interface KMOpenGlRenderingContextInterface +{ + + actual fun resume() + + actual fun pause() + + actual fun getCreateRenderTarget(name: String, textureFilter: KMTextureFilterType, clearColor: KMColor, usesDepthStencil: Boolean): KMOpenGlRenderTargetInterface + + actual fun deleteRenderTarget(name: String) + + actual fun getRenderTargets(): ArrayList + + actual fun getProgram(name: String): Int + + actual fun storeProgram(name: String, program: Int) + + actual fun getAspectRatio(): Float + + actual fun getDeltaTimeMs(): Long +} + +private class KMOpenGlRenderingContextInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCOpenGlRenderingContextInterfaceProtocol) : KMOpenGlRenderingContextInterface +{ + + override fun resume() { + nativeHandle.resume() + } + + override fun pause() { + nativeHandle.pause() + } + + override fun getCreateRenderTarget(name: String, textureFilter: KMTextureFilterType, clearColor: KMColor, usesDepthStencil: Boolean): KMOpenGlRenderTargetInterface { + val result = nativeHandle.getCreateRenderTarget(name, textureFilter.asPlatform(), clearColor.asPlatform(), usesDepthStencil) + return (result as MapCoreSharedModule.MCOpenGlRenderTargetInterfaceProtocol).asKmp() + } + + override fun deleteRenderTarget(name: String) { + nativeHandle.deleteRenderTarget(name) + } + + override fun getRenderTargets(): ArrayList { + val result = nativeHandle.getRenderTargets() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCOpenGlRenderTargetInterfaceProtocol).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCOpenGlRenderTargetInterfaceProtocol).asKmp() })) + } + + override fun getProgram(name: String): Int { + val result = nativeHandle.getProgram(name) + return result + } + + override fun storeProgram(name: String, program: Int) { + nativeHandle.storeProgram(name, program) + } + + override fun getAspectRatio(): Float { + val result = nativeHandle.getAspectRatio() + return result + } + + override fun getDeltaTimeMs(): Long { + val result = nativeHandle.getDeltaTimeMs() + return result + } +} + +private class KMOpenGlRenderingContextInterfacePlatformProxy(private val delegate: KMOpenGlRenderingContextInterface) : NSObject(), MapCoreSharedModule.MCOpenGlRenderingContextInterfaceProtocol +{ + + override fun resume() { + delegate.resume() + } + + override fun pause() { + delegate.pause() + } + + override fun getCreateRenderTarget(name: String, textureFilter: MapCoreSharedModule.MCTextureFilterType, clearColor: MapCoreSharedModule.MCColor, usesDepthStencil: Boolean): MapCoreSharedModule.MCOpenGlRenderTargetInterfaceProtocol? { + val result = delegate.getCreateRenderTarget(name, KMTextureFilterType.fromPlatform((textureFilter as MapCoreSharedModule.MCTextureFilterType)), (clearColor as MapCoreSharedModule.MCColor).asKmp(), usesDepthStencil) + return result.asPlatform() + } + + override fun deleteRenderTarget(name: String) { + delegate.deleteRenderTarget(name) + } + + override fun getRenderTargets(): List<*> { + val result = delegate.getRenderTargets() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun getProgram(name: String): Int { + val result = delegate.getProgram(name) + return result + } + + override fun storeProgram(name: String, program: Int) { + delegate.storeProgram(name, program) + } + + override fun getAspectRatio(): Float { + val result = delegate.getAspectRatio() + return result + } + + override fun getDeltaTimeMs(): Long { + val result = delegate.getDeltaTimeMs() + return result + } +} + +internal fun KMOpenGlRenderingContextInterface.asPlatform(): MapCoreSharedModule.MCOpenGlRenderingContextInterfaceProtocol = when (this) { + is KMOpenGlRenderingContextInterfacePlatformWrapper -> this.nativeHandle + else -> KMOpenGlRenderingContextInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCOpenGlRenderingContextInterfaceProtocol.asKmp(): KMOpenGlRenderingContextInterface = KMOpenGlRenderingContextInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPerformanceLoggerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPerformanceLoggerInterface.kt new file mode 100644 index 000000000..dc65348bd --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPerformanceLoggerInterface.kt @@ -0,0 +1,106 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMPerformanceLoggerInterface", exact = true) +actual interface KMPerformanceLoggerInterface +{ + + actual fun getLoggerName(): String + + actual fun startLog(id: String) + + actual fun endLog(id: String) + + actual fun getStatistics(id: String): KMLoggerData? + + actual fun getAllStatistics(): ArrayList + + actual fun resetData() + + actual fun setLoggingEnabled(enabled: Boolean) +} + +private class KMPerformanceLoggerInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCPerformanceLoggerInterfaceProtocol) : KMPerformanceLoggerInterface +{ + + override fun getLoggerName(): String { + val result = nativeHandle.getLoggerName() + return result + } + + override fun startLog(id: String) { + nativeHandle.startLog(id) + } + + override fun endLog(id: String) { + nativeHandle.endLog(id) + } + + override fun getStatistics(id: String): KMLoggerData? { + val result = nativeHandle.getStatistics(id) + return result?.let { (it as MapCoreSharedModule.MCLoggerData).asKmp() } + } + + override fun getAllStatistics(): ArrayList { + val result = nativeHandle.getAllStatistics() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCLoggerData).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCLoggerData).asKmp() })) + } + + override fun resetData() { + nativeHandle.resetData() + } + + override fun setLoggingEnabled(enabled: Boolean) { + nativeHandle.setLoggingEnabled(enabled) + } +} + +private class KMPerformanceLoggerInterfacePlatformProxy(private val delegate: KMPerformanceLoggerInterface) : NSObject(), MapCoreSharedModule.MCPerformanceLoggerInterfaceProtocol +{ + + override fun getLoggerName(): String { + val result = delegate.getLoggerName() + return result + } + + override fun startLog(id: String) { + delegate.startLog(id) + } + + override fun endLog(id: String) { + delegate.endLog(id) + } + + override fun getStatistics(id: String): MapCoreSharedModule.MCLoggerData? { + val result = delegate.getStatistics(id) + return result?.let { it.asPlatform() } + } + + override fun getAllStatistics(): List<*> { + val result = delegate.getAllStatistics() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun resetData() { + delegate.resetData() + } + + override fun setLoggingEnabled(enabled: Boolean) { + delegate.setLoggingEnabled(enabled) + } +} + +internal fun KMPerformanceLoggerInterface.asPlatform(): MapCoreSharedModule.MCPerformanceLoggerInterfaceProtocol = when (this) { + is KMPerformanceLoggerInterfacePlatformWrapper -> this.nativeHandle + else -> KMPerformanceLoggerInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCPerformanceLoggerInterfaceProtocol.asKmp(): KMPerformanceLoggerInterface = KMPerformanceLoggerInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygon2dInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygon2dInterface.kt new file mode 100644 index 000000000..e3c50e74e --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygon2dInterface.kt @@ -0,0 +1,74 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMPolygon2dInterface", exact = true) +actual interface KMPolygon2dInterface +{ + + actual fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D, is3d: Boolean) + + actual fun setSubdivisionFactor(factor: Int) + + actual fun asGraphicsObject(): KMGraphicsObjectInterface + + actual fun asMaskingObject(): KMMaskingObjectInterface +} + +private class KMPolygon2dInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCPolygon2dInterfaceProtocol) : KMPolygon2dInterface +{ + + override fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D, is3d: Boolean) { + nativeHandle.setVertices(vertices.asPlatform(), indices.asPlatform(), origin.asPlatform(), is3d) + } + + override fun setSubdivisionFactor(factor: Int) { + nativeHandle.setSubdivisionFactor(factor) + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol).asKmp() + } + + override fun asMaskingObject(): KMMaskingObjectInterface { + val result = nativeHandle.asMaskingObject() + return (result as MapCoreSharedModule.MCMaskingObjectInterfaceProtocol).asKmp() + } +} + +private class KMPolygon2dInterfacePlatformProxy(private val delegate: KMPolygon2dInterface) : NSObject(), MapCoreSharedModule.MCPolygon2dInterfaceProtocol +{ + + override fun setVertices(vertices: MapCoreSharedModule.MCSharedBytes, indices: MapCoreSharedModule.MCSharedBytes, origin: MapCoreSharedModule.MCVec3D, is3d: Boolean) { + delegate.setVertices((vertices as MapCoreSharedModule.MCSharedBytes).asKmp(), (indices as MapCoreSharedModule.MCSharedBytes).asKmp(), (origin as MapCoreSharedModule.MCVec3D).asKmp(), is3d) + } + + override fun setSubdivisionFactor(factor: Int) { + delegate.setSubdivisionFactor(factor) + } + + override fun asGraphicsObject(): MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol? { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } + + override fun asMaskingObject(): MapCoreSharedModule.MCMaskingObjectInterfaceProtocol? { + val result = delegate.asMaskingObject() + return result.asPlatform() + } +} + +internal fun KMPolygon2dInterface.asPlatform(): MapCoreSharedModule.MCPolygon2dInterfaceProtocol = when (this) { + is KMPolygon2dInterfacePlatformWrapper -> this.nativeHandle + else -> KMPolygon2dInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCPolygon2dInterfaceProtocol.asKmp(): KMPolygon2dInterface = KMPolygon2dInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonCoord.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonCoord.kt new file mode 100644 index 000000000..c439848aa --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonCoord.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMPolygonCoord", exact = true) +actual class KMPolygonCoord actual public constructor( + positions: ArrayList, + holes: ArrayList>, +) { + actual val positions: ArrayList = positions + actual val holes: ArrayList> = holes +} + +internal fun KMPolygonCoord.asPlatform(): MapCoreSharedModule.MCPolygonCoord = MapCoreSharedModule.MCPolygonCoord( + positions = ArrayList(positions.map { it.asPlatform() }), + holes = ArrayList(holes.map { ArrayList(it.map { it.asPlatform() }) }), +) +public fun MapCoreSharedModule.MCPolygonCoord.asKmp(): KMPolygonCoord = KMPolygonCoord( + positions = ArrayList(((this.positions as? List<*>)?.map { (it as MapCoreSharedModule.MCCoord).asKmp() } ?: (0 until (this.positions as platform.Foundation.NSArray).count.toInt()).map { idx -> ((this.positions as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCCoord).asKmp() })), + holes = ArrayList(((this.holes as? List<*>)?.map { ArrayList(((it as? List<*>)?.map { (it as MapCoreSharedModule.MCCoord).asKmp() } ?: (0 until (it as platform.Foundation.NSArray).count.toInt()).map { idx -> ((it as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCCoord).asKmp() })) } ?: (0 until (this.holes as platform.Foundation.NSArray).count.toInt()).map { idx -> ArrayList((((this.holes as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as? List<*>)?.map { (it as MapCoreSharedModule.MCCoord).asKmp() } ?: (0 until ((this.holes as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as platform.Foundation.NSArray).count.toInt()).map { idx -> (((this.holes as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCCoord).asKmp() })) })), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroup2dInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroup2dInterface.kt new file mode 100644 index 000000000..6509f2fd2 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroup2dInterface.kt @@ -0,0 +1,52 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMPolygonGroup2dInterface", exact = true) +actual interface KMPolygonGroup2dInterface +{ + + actual fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) + + actual fun asGraphicsObject(): KMGraphicsObjectInterface +} + +private class KMPolygonGroup2dInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCPolygonGroup2dInterfaceProtocol) : KMPolygonGroup2dInterface +{ + + override fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) { + nativeHandle.setVertices(vertices.asPlatform(), indices.asPlatform(), origin.asPlatform()) + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol).asKmp() + } +} + +private class KMPolygonGroup2dInterfacePlatformProxy(private val delegate: KMPolygonGroup2dInterface) : NSObject(), MapCoreSharedModule.MCPolygonGroup2dInterfaceProtocol +{ + + override fun setVertices(vertices: MapCoreSharedModule.MCSharedBytes, indices: MapCoreSharedModule.MCSharedBytes, origin: MapCoreSharedModule.MCVec3D) { + delegate.setVertices((vertices as MapCoreSharedModule.MCSharedBytes).asKmp(), (indices as MapCoreSharedModule.MCSharedBytes).asKmp(), (origin as MapCoreSharedModule.MCVec3D).asKmp()) + } + + override fun asGraphicsObject(): MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol? { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } +} + +internal fun KMPolygonGroup2dInterface.asPlatform(): MapCoreSharedModule.MCPolygonGroup2dInterfaceProtocol = when (this) { + is KMPolygonGroup2dInterfacePlatformWrapper -> this.nativeHandle + else -> KMPolygonGroup2dInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCPolygonGroup2dInterfaceProtocol.asKmp(): KMPolygonGroup2dInterface = KMPolygonGroup2dInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroupShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroupShaderInterface.kt new file mode 100644 index 000000000..9845803ea --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonGroupShaderInterface.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMPolygonGroupShaderInterface", exact = true) +actual class KMPolygonGroupShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCPolygonGroupShaderInterfaceProtocol + + actual fun setStyles(styles: KMSharedBytes) { + native.setStyles(styles.asPlatform()) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } +} + +internal fun KMPolygonGroupShaderInterface.asPlatform(): MapCoreSharedModule.MCPolygonGroupShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCPolygonGroupShaderInterfaceProtocol +public fun MapCoreSharedModule.MCPolygonGroupShaderInterfaceProtocol.asKmp(): KMPolygonGroupShaderInterface = KMPolygonGroupShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonInfo.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonInfo.kt new file mode 100644 index 000000000..30162a088 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonInfo.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMPolygonInfo", exact = true) +actual class KMPolygonInfo actual public constructor( + identifier: String, + coordinates: KMPolygonCoord, + color: KMColor, + highlightColor: KMColor, +) { + actual val identifier: String = identifier + actual val coordinates: KMPolygonCoord = coordinates + actual val color: KMColor = color + actual val highlightColor: KMColor = highlightColor +} + +internal fun KMPolygonInfo.asPlatform(): MapCoreSharedModule.MCPolygonInfo = MapCoreSharedModule.MCPolygonInfo( + identifier = identifier, + coordinates = coordinates.asPlatform(), + color = color.asPlatform(), + highlightColor = highlightColor.asPlatform(), +) +public fun MapCoreSharedModule.MCPolygonInfo.asKmp(): KMPolygonInfo = KMPolygonInfo( + identifier = this.identifier, + coordinates = (this.coordinates as MapCoreSharedModule.MCPolygonCoord).asKmp(), + color = (this.color as MapCoreSharedModule.MCColor).asKmp(), + highlightColor = (this.highlightColor as MapCoreSharedModule.MCColor).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerCallbackInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerCallbackInterface.kt new file mode 100644 index 000000000..809c6144d --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerCallbackInterface.kt @@ -0,0 +1,54 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMPolygonLayerCallbackInterface", exact = true) +actual interface KMPolygonLayerCallbackInterface +{ + + actual fun onClickConfirmed(polygon: KMPolygonInfo): Boolean + + actual fun onClickUnconfirmed(polygon: KMPolygonInfo): Boolean +} + +private class KMPolygonLayerCallbackInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCPolygonLayerCallbackInterfaceProtocol) : KMPolygonLayerCallbackInterface +{ + + override fun onClickConfirmed(polygon: KMPolygonInfo): Boolean { + val result = nativeHandle.onClickConfirmed(polygon.asPlatform()) + return result + } + + override fun onClickUnconfirmed(polygon: KMPolygonInfo): Boolean { + val result = nativeHandle.onClickUnconfirmed(polygon.asPlatform()) + return result + } +} + +private class KMPolygonLayerCallbackInterfacePlatformProxy(private val delegate: KMPolygonLayerCallbackInterface) : NSObject(), MapCoreSharedModule.MCPolygonLayerCallbackInterfaceProtocol +{ + + override fun onClickConfirmed(polygon: MapCoreSharedModule.MCPolygonInfo): Boolean { + val result = delegate.onClickConfirmed((polygon as MapCoreSharedModule.MCPolygonInfo).asKmp()) + return result + } + + override fun onClickUnconfirmed(polygon: MapCoreSharedModule.MCPolygonInfo): Boolean { + val result = delegate.onClickUnconfirmed((polygon as MapCoreSharedModule.MCPolygonInfo).asKmp()) + return result + } +} + +internal fun KMPolygonLayerCallbackInterface.asPlatform(): MapCoreSharedModule.MCPolygonLayerCallbackInterfaceProtocol = when (this) { + is KMPolygonLayerCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMPolygonLayerCallbackInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCPolygonLayerCallbackInterfaceProtocol.asKmp(): KMPolygonLayerCallbackInterface = KMPolygonLayerCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerInterface.kt new file mode 100644 index 000000000..a51ea809f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonLayerInterface.kt @@ -0,0 +1,76 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMPolygonLayerInterface", exact = true) +actual class KMPolygonLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCPolygonLayerInterface + + actual fun setPolygons(polygons: ArrayList, origin: KMVec3D) { + native.setPolygons(ArrayList(polygons.map { it.asPlatform() }), origin.asPlatform()) + } + + actual fun getPolygons(): ArrayList { + val result = native.getPolygons() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCPolygonInfo).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCPolygonInfo).asKmp() })) + } + + actual fun remove(polygon: KMPolygonInfo) { + native.remove(polygon.asPlatform()) + } + + actual fun add(polygon: KMPolygonInfo) { + native.add(polygon.asPlatform()) + } + + actual fun addAll(polygons: ArrayList) { + native.addAll(ArrayList(polygons.map { it.asPlatform() })) + } + + actual fun clear() { + native.clear() + } + + actual fun setCallbackHandler(handler: KMPolygonLayerCallbackInterface) { + native.setCallbackHandler(handler.asPlatform()) + } + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as MapCoreSharedModule.MCLayerInterfaceProtocol).asKmp() + } + + actual fun resetSelection() { + native.resetSelection() + } + + actual fun setLayerClickable(isLayerClickable: Boolean) { + native.setLayerClickable(isLayerClickable) + } + + actual fun setRenderPassIndex(index: Int) { + native.setRenderPassIndex(index) + } + + actual companion object + { + + actual fun create(): KMPolygonLayerInterface { + val result = MapCoreSharedModule.MCPolygonLayerInterface.create() + return (result as MapCoreSharedModule.MCPolygonLayerInterface).asKmp() + } + } +} + +internal fun KMPolygonLayerInterface.asPlatform(): MapCoreSharedModule.MCPolygonLayerInterface = nativeHandle as MapCoreSharedModule.MCPolygonLayerInterface +public fun MapCoreSharedModule.MCPolygonLayerInterface.asKmp(): KMPolygonLayerInterface = KMPolygonLayerInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonMaskObjectInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonMaskObjectInterface.kt new file mode 100644 index 000000000..ac8d575da --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonMaskObjectInterface.kt @@ -0,0 +1,43 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMPolygonMaskObjectInterface", exact = true) +actual class KMPolygonMaskObjectInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCPolygonMaskObjectInterface + + actual fun setPolygons(polygons: ArrayList, origin: KMVec3D) { + native.setPolygons(ArrayList(polygons.map { it.asPlatform() }), origin.asPlatform()) + } + + actual fun setPolygon(polygon: KMPolygonCoord, origin: KMVec3D) { + native.setPolygon(polygon.asPlatform(), origin.asPlatform()) + } + + actual fun getPolygonObject(): KMPolygon2dInterface { + val result = native.getPolygonObject() + return (result as MapCoreSharedModule.MCPolygon2dInterfaceProtocol).asKmp() + } + + actual companion object + { + + actual fun create(graphicsObjectFactory: KMGraphicsObjectFactoryInterface, conversionHelper: KMCoordinateConversionHelperInterface, is3d: Boolean): KMPolygonMaskObjectInterface { + val result = MapCoreSharedModule.MCPolygonMaskObjectInterface.create(graphicsObjectFactory.asPlatform(), conversionHelper.asPlatform(), is3d) + return (result as MapCoreSharedModule.MCPolygonMaskObjectInterface).asKmp() + } + } +} + +internal fun KMPolygonMaskObjectInterface.asPlatform(): MapCoreSharedModule.MCPolygonMaskObjectInterface = nativeHandle as MapCoreSharedModule.MCPolygonMaskObjectInterface +public fun MapCoreSharedModule.MCPolygonMaskObjectInterface.asKmp(): KMPolygonMaskObjectInterface = KMPolygonMaskObjectInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroup2dInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroup2dInterface.kt new file mode 100644 index 000000000..fa18a31a0 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroup2dInterface.kt @@ -0,0 +1,112 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMPolygonPatternGroup2dInterface", exact = true) +actual interface KMPolygonPatternGroup2dInterface +{ + + actual fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) + + actual fun setOpacities(values: KMSharedBytes) + + actual fun setTextureCoordinates(values: KMSharedBytes) + + actual fun setScalingFactor(factor: Float) + + actual fun setScalingFactors(factor: KMVec2F) + + actual fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + actual fun removeTexture() + + actual fun asGraphicsObject(): KMGraphicsObjectInterface +} + +private class KMPolygonPatternGroup2dInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCPolygonPatternGroup2dInterfaceProtocol) : KMPolygonPatternGroup2dInterface +{ + + override fun setVertices(vertices: KMSharedBytes, indices: KMSharedBytes, origin: KMVec3D) { + nativeHandle.setVertices(vertices.asPlatform(), indices.asPlatform(), origin.asPlatform()) + } + + override fun setOpacities(values: KMSharedBytes) { + nativeHandle.setOpacities(values.asPlatform()) + } + + override fun setTextureCoordinates(values: KMSharedBytes) { + nativeHandle.setTextureCoordinates(values.asPlatform()) + } + + override fun setScalingFactor(factor: Float) { + nativeHandle.setScalingFactor(factor) + } + + override fun setScalingFactors(factor: KMVec2F) { + nativeHandle.setScalingFactors(factor.asPlatform()) + } + + override fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) { + nativeHandle.loadTexture(context.asPlatform(), textureHolder.asPlatform()) + } + + override fun removeTexture() { + nativeHandle.removeTexture() + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol).asKmp() + } +} + +private class KMPolygonPatternGroup2dInterfacePlatformProxy(private val delegate: KMPolygonPatternGroup2dInterface) : NSObject(), MapCoreSharedModule.MCPolygonPatternGroup2dInterfaceProtocol +{ + + override fun setVertices(vertices: MapCoreSharedModule.MCSharedBytes, indices: MapCoreSharedModule.MCSharedBytes, origin: MapCoreSharedModule.MCVec3D) { + delegate.setVertices((vertices as MapCoreSharedModule.MCSharedBytes).asKmp(), (indices as MapCoreSharedModule.MCSharedBytes).asKmp(), (origin as MapCoreSharedModule.MCVec3D).asKmp()) + } + + override fun setOpacities(values: MapCoreSharedModule.MCSharedBytes) { + delegate.setOpacities((values as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setTextureCoordinates(values: MapCoreSharedModule.MCSharedBytes) { + delegate.setTextureCoordinates((values as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setScalingFactor(factor: Float) { + delegate.setScalingFactor(factor) + } + + override fun setScalingFactors(factor: MapCoreSharedModule.MCVec2F) { + delegate.setScalingFactors((factor as MapCoreSharedModule.MCVec2F).asKmp()) + } + + override fun loadTexture(context: MapCoreSharedModule.MCRenderingContextInterfaceProtocol?, textureHolder: MapCoreSharedModule.MCTextureHolderInterfaceProtocol?) { + delegate.loadTexture((context as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp(), (textureHolder as MapCoreSharedModule.MCTextureHolderInterfaceProtocol).asKmp()) + } + + override fun removeTexture() { + delegate.removeTexture() + } + + override fun asGraphicsObject(): MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol? { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } +} + +internal fun KMPolygonPatternGroup2dInterface.asPlatform(): MapCoreSharedModule.MCPolygonPatternGroup2dInterfaceProtocol = when (this) { + is KMPolygonPatternGroup2dInterfacePlatformWrapper -> this.nativeHandle + else -> KMPolygonPatternGroup2dInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCPolygonPatternGroup2dInterfaceProtocol.asKmp(): KMPolygonPatternGroup2dInterface = KMPolygonPatternGroup2dInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroupShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroupShaderInterface.kt new file mode 100644 index 000000000..e51ac444e --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonPatternGroupShaderInterface.kt @@ -0,0 +1,26 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMPolygonPatternGroupShaderInterface", exact = true) +actual class KMPolygonPatternGroupShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCPolygonPatternGroupShaderInterfaceProtocol + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } +} + +internal fun KMPolygonPatternGroupShaderInterface.asPlatform(): MapCoreSharedModule.MCPolygonPatternGroupShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCPolygonPatternGroupShaderInterfaceProtocol +public fun MapCoreSharedModule.MCPolygonPatternGroupShaderInterfaceProtocol.asKmp(): KMPolygonPatternGroupShaderInterface = KMPolygonPatternGroupShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonStyle.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonStyle.kt new file mode 100644 index 000000000..e36c5374f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMPolygonStyle.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from polygon.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMPolygonStyle", exact = true) +actual class KMPolygonStyle actual public constructor( + color: KMColor, + opacity: Float, +) { + actual val color: KMColor = color + actual val opacity: Float = opacity +} + +internal fun KMPolygonStyle.asPlatform(): MapCoreSharedModule.MCPolygonStyle = MapCoreSharedModule.MCPolygonStyle( + color = color.asPlatform(), + opacity = opacity, +) +public fun MapCoreSharedModule.MCPolygonStyle.asKmp(): KMPolygonStyle = KMPolygonStyle( + color = (this.color as MapCoreSharedModule.MCColor).asKmp(), + opacity = this.opacity, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dD.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dD.kt new file mode 100644 index 000000000..215037f03 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dD.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMQuad2dD", exact = true) +actual class KMQuad2dD actual public constructor( + topLeft: KMVec2D, + topRight: KMVec2D, + bottomRight: KMVec2D, + bottomLeft: KMVec2D, +) { + actual val topLeft: KMVec2D = topLeft + actual val topRight: KMVec2D = topRight + actual val bottomRight: KMVec2D = bottomRight + actual val bottomLeft: KMVec2D = bottomLeft +} + +internal fun KMQuad2dD.asPlatform(): MapCoreSharedModule.MCQuad2dD = MapCoreSharedModule.MCQuad2dD( + topLeft = topLeft.asPlatform(), + topRight = topRight.asPlatform(), + bottomRight = bottomRight.asPlatform(), + bottomLeft = bottomLeft.asPlatform(), +) +public fun MapCoreSharedModule.MCQuad2dD.asKmp(): KMQuad2dD = KMQuad2dD( + topLeft = (this.topLeft as MapCoreSharedModule.MCVec2D).asKmp(), + topRight = (this.topRight as MapCoreSharedModule.MCVec2D).asKmp(), + bottomRight = (this.bottomRight as MapCoreSharedModule.MCVec2D).asKmp(), + bottomLeft = (this.bottomLeft as MapCoreSharedModule.MCVec2D).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInstancedInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInstancedInterface.kt new file mode 100644 index 000000000..e7068015b --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInstancedInterface.kt @@ -0,0 +1,154 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMQuad2dInstancedInterface", exact = true) +actual interface KMQuad2dInstancedInterface +{ + + actual fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) + + actual fun setInstanceCount(count: Int) + + actual fun setPositions(positions: KMSharedBytes) + + actual fun setScales(scales: KMSharedBytes) + + actual fun setRotations(rotations: KMSharedBytes) + + actual fun setAlphas(values: KMSharedBytes) + + actual fun setTextureCoordinates(textureCoordinates: KMSharedBytes) + + actual fun setPositionOffset(offsets: KMSharedBytes) + + actual fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + actual fun removeTexture() + + actual fun asGraphicsObject(): KMGraphicsObjectInterface + + actual fun asMaskingObject(): KMMaskingObjectInterface +} + +private class KMQuad2dInstancedInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCQuad2dInstancedInterfaceProtocol) : KMQuad2dInstancedInterface +{ + + override fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) { + nativeHandle.setFrame(frame.asPlatform(), origin.asPlatform(), is3d) + } + + override fun setInstanceCount(count: Int) { + nativeHandle.setInstanceCount(count) + } + + override fun setPositions(positions: KMSharedBytes) { + nativeHandle.setPositions(positions.asPlatform()) + } + + override fun setScales(scales: KMSharedBytes) { + nativeHandle.setScales(scales.asPlatform()) + } + + override fun setRotations(rotations: KMSharedBytes) { + nativeHandle.setRotations(rotations.asPlatform()) + } + + override fun setAlphas(values: KMSharedBytes) { + nativeHandle.setAlphas(values.asPlatform()) + } + + override fun setTextureCoordinates(textureCoordinates: KMSharedBytes) { + nativeHandle.setTextureCoordinates(textureCoordinates.asPlatform()) + } + + override fun setPositionOffset(offsets: KMSharedBytes) { + nativeHandle.setPositionOffset(offsets.asPlatform()) + } + + override fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) { + nativeHandle.loadTexture(context.asPlatform(), textureHolder.asPlatform()) + } + + override fun removeTexture() { + nativeHandle.removeTexture() + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol).asKmp() + } + + override fun asMaskingObject(): KMMaskingObjectInterface { + val result = nativeHandle.asMaskingObject() + return (result as MapCoreSharedModule.MCMaskingObjectInterfaceProtocol).asKmp() + } +} + +private class KMQuad2dInstancedInterfacePlatformProxy(private val delegate: KMQuad2dInstancedInterface) : NSObject(), MapCoreSharedModule.MCQuad2dInstancedInterfaceProtocol +{ + + override fun setFrame(frame: MapCoreSharedModule.MCQuad2dD, origin: MapCoreSharedModule.MCVec3D, is3d: Boolean) { + delegate.setFrame((frame as MapCoreSharedModule.MCQuad2dD).asKmp(), (origin as MapCoreSharedModule.MCVec3D).asKmp(), is3d) + } + + override fun setInstanceCount(count: Int) { + delegate.setInstanceCount(count) + } + + override fun setPositions(positions: MapCoreSharedModule.MCSharedBytes) { + delegate.setPositions((positions as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setScales(scales: MapCoreSharedModule.MCSharedBytes) { + delegate.setScales((scales as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setRotations(rotations: MapCoreSharedModule.MCSharedBytes) { + delegate.setRotations((rotations as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setAlphas(values: MapCoreSharedModule.MCSharedBytes) { + delegate.setAlphas((values as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setTextureCoordinates(textureCoordinates: MapCoreSharedModule.MCSharedBytes) { + delegate.setTextureCoordinates((textureCoordinates as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setPositionOffset(offsets: MapCoreSharedModule.MCSharedBytes) { + delegate.setPositionOffset((offsets as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun loadTexture(context: MapCoreSharedModule.MCRenderingContextInterfaceProtocol?, textureHolder: MapCoreSharedModule.MCTextureHolderInterfaceProtocol?) { + delegate.loadTexture((context as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp(), (textureHolder as MapCoreSharedModule.MCTextureHolderInterfaceProtocol).asKmp()) + } + + override fun removeTexture() { + delegate.removeTexture() + } + + override fun asGraphicsObject(): MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol? { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } + + override fun asMaskingObject(): MapCoreSharedModule.MCMaskingObjectInterfaceProtocol? { + val result = delegate.asMaskingObject() + return result.asPlatform() + } +} + +internal fun KMQuad2dInstancedInterface.asPlatform(): MapCoreSharedModule.MCQuad2dInstancedInterfaceProtocol = when (this) { + is KMQuad2dInstancedInterfacePlatformWrapper -> this.nativeHandle + else -> KMQuad2dInstancedInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCQuad2dInstancedInterfaceProtocol.asKmp(): KMQuad2dInstancedInterface = KMQuad2dInstancedInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInterface.kt new file mode 100644 index 000000000..fb134d309 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dInterface.kt @@ -0,0 +1,104 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMQuad2dInterface", exact = true) +actual interface KMQuad2dInterface +{ + + actual fun setFrame(frame: KMQuad3dD, textureCoordinates: KMRectD, origin: KMVec3D, is3d: Boolean) + + actual fun setSubdivisionFactor(factor: Int) + + actual fun setMinMagFilter(filterType: KMTextureFilterType) + + actual fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + actual fun removeTexture() + + actual fun asGraphicsObject(): KMGraphicsObjectInterface + + actual fun asMaskingObject(): KMMaskingObjectInterface +} + +private class KMQuad2dInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCQuad2dInterfaceProtocol) : KMQuad2dInterface +{ + + override fun setFrame(frame: KMQuad3dD, textureCoordinates: KMRectD, origin: KMVec3D, is3d: Boolean) { + nativeHandle.setFrame(frame.asPlatform(), textureCoordinates.asPlatform(), origin.asPlatform(), is3d) + } + + override fun setSubdivisionFactor(factor: Int) { + nativeHandle.setSubdivisionFactor(factor) + } + + override fun setMinMagFilter(filterType: KMTextureFilterType) { + nativeHandle.setMinMagFilter(filterType.asPlatform()) + } + + override fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) { + nativeHandle.loadTexture(context.asPlatform(), textureHolder.asPlatform()) + } + + override fun removeTexture() { + nativeHandle.removeTexture() + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol).asKmp() + } + + override fun asMaskingObject(): KMMaskingObjectInterface { + val result = nativeHandle.asMaskingObject() + return (result as MapCoreSharedModule.MCMaskingObjectInterfaceProtocol).asKmp() + } +} + +private class KMQuad2dInterfacePlatformProxy(private val delegate: KMQuad2dInterface) : NSObject(), MapCoreSharedModule.MCQuad2dInterfaceProtocol +{ + + override fun setFrame(frame: MapCoreSharedModule.MCQuad3dD, textureCoordinates: MapCoreSharedModule.MCRectD, origin: MapCoreSharedModule.MCVec3D, is3d: Boolean) { + delegate.setFrame((frame as MapCoreSharedModule.MCQuad3dD).asKmp(), (textureCoordinates as MapCoreSharedModule.MCRectD).asKmp(), (origin as MapCoreSharedModule.MCVec3D).asKmp(), is3d) + } + + override fun setSubdivisionFactor(factor: Int) { + delegate.setSubdivisionFactor(factor) + } + + override fun setMinMagFilter(filterType: MapCoreSharedModule.MCTextureFilterType) { + delegate.setMinMagFilter(KMTextureFilterType.fromPlatform((filterType as MapCoreSharedModule.MCTextureFilterType))) + } + + override fun loadTexture(context: MapCoreSharedModule.MCRenderingContextInterfaceProtocol?, textureHolder: MapCoreSharedModule.MCTextureHolderInterfaceProtocol?) { + delegate.loadTexture((context as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp(), (textureHolder as MapCoreSharedModule.MCTextureHolderInterfaceProtocol).asKmp()) + } + + override fun removeTexture() { + delegate.removeTexture() + } + + override fun asGraphicsObject(): MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol? { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } + + override fun asMaskingObject(): MapCoreSharedModule.MCMaskingObjectInterfaceProtocol? { + val result = delegate.asMaskingObject() + return result.asPlatform() + } +} + +internal fun KMQuad2dInterface.asPlatform(): MapCoreSharedModule.MCQuad2dInterfaceProtocol = when (this) { + is KMQuad2dInterfacePlatformWrapper -> this.nativeHandle + else -> KMQuad2dInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCQuad2dInterfaceProtocol.asKmp(): KMQuad2dInterface = KMQuad2dInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dStretchedInstancedInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dStretchedInstancedInterface.kt new file mode 100644 index 000000000..238c2d081 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad2dStretchedInstancedInterface.kt @@ -0,0 +1,154 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMQuad2dStretchedInstancedInterface", exact = true) +actual interface KMQuad2dStretchedInstancedInterface +{ + + actual fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) + + actual fun setInstanceCount(count: Int) + + actual fun setPositions(positions: KMSharedBytes) + + actual fun setScales(scales: KMSharedBytes) + + actual fun setRotations(rotations: KMSharedBytes) + + actual fun setAlphas(values: KMSharedBytes) + + actual fun setStretchInfos(values: KMSharedBytes) + + actual fun setTextureCoordinates(textureCoordinates: KMSharedBytes) + + actual fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + actual fun removeTexture() + + actual fun asGraphicsObject(): KMGraphicsObjectInterface + + actual fun asMaskingObject(): KMMaskingObjectInterface +} + +private class KMQuad2dStretchedInstancedInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCQuad2dStretchedInstancedInterfaceProtocol) : KMQuad2dStretchedInstancedInterface +{ + + override fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) { + nativeHandle.setFrame(frame.asPlatform(), origin.asPlatform(), is3d) + } + + override fun setInstanceCount(count: Int) { + nativeHandle.setInstanceCount(count) + } + + override fun setPositions(positions: KMSharedBytes) { + nativeHandle.setPositions(positions.asPlatform()) + } + + override fun setScales(scales: KMSharedBytes) { + nativeHandle.setScales(scales.asPlatform()) + } + + override fun setRotations(rotations: KMSharedBytes) { + nativeHandle.setRotations(rotations.asPlatform()) + } + + override fun setAlphas(values: KMSharedBytes) { + nativeHandle.setAlphas(values.asPlatform()) + } + + override fun setStretchInfos(values: KMSharedBytes) { + nativeHandle.setStretchInfos(values.asPlatform()) + } + + override fun setTextureCoordinates(textureCoordinates: KMSharedBytes) { + nativeHandle.setTextureCoordinates(textureCoordinates.asPlatform()) + } + + override fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) { + nativeHandle.loadTexture(context.asPlatform(), textureHolder.asPlatform()) + } + + override fun removeTexture() { + nativeHandle.removeTexture() + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol).asKmp() + } + + override fun asMaskingObject(): KMMaskingObjectInterface { + val result = nativeHandle.asMaskingObject() + return (result as MapCoreSharedModule.MCMaskingObjectInterfaceProtocol).asKmp() + } +} + +private class KMQuad2dStretchedInstancedInterfacePlatformProxy(private val delegate: KMQuad2dStretchedInstancedInterface) : NSObject(), MapCoreSharedModule.MCQuad2dStretchedInstancedInterfaceProtocol +{ + + override fun setFrame(frame: MapCoreSharedModule.MCQuad2dD, origin: MapCoreSharedModule.MCVec3D, is3d: Boolean) { + delegate.setFrame((frame as MapCoreSharedModule.MCQuad2dD).asKmp(), (origin as MapCoreSharedModule.MCVec3D).asKmp(), is3d) + } + + override fun setInstanceCount(count: Int) { + delegate.setInstanceCount(count) + } + + override fun setPositions(positions: MapCoreSharedModule.MCSharedBytes) { + delegate.setPositions((positions as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setScales(scales: MapCoreSharedModule.MCSharedBytes) { + delegate.setScales((scales as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setRotations(rotations: MapCoreSharedModule.MCSharedBytes) { + delegate.setRotations((rotations as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setAlphas(values: MapCoreSharedModule.MCSharedBytes) { + delegate.setAlphas((values as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setStretchInfos(values: MapCoreSharedModule.MCSharedBytes) { + delegate.setStretchInfos((values as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setTextureCoordinates(textureCoordinates: MapCoreSharedModule.MCSharedBytes) { + delegate.setTextureCoordinates((textureCoordinates as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun loadTexture(context: MapCoreSharedModule.MCRenderingContextInterfaceProtocol?, textureHolder: MapCoreSharedModule.MCTextureHolderInterfaceProtocol?) { + delegate.loadTexture((context as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp(), (textureHolder as MapCoreSharedModule.MCTextureHolderInterfaceProtocol).asKmp()) + } + + override fun removeTexture() { + delegate.removeTexture() + } + + override fun asGraphicsObject(): MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol? { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } + + override fun asMaskingObject(): MapCoreSharedModule.MCMaskingObjectInterfaceProtocol? { + val result = delegate.asMaskingObject() + return result.asPlatform() + } +} + +internal fun KMQuad2dStretchedInstancedInterface.asPlatform(): MapCoreSharedModule.MCQuad2dStretchedInstancedInterfaceProtocol = when (this) { + is KMQuad2dStretchedInstancedInterfacePlatformWrapper -> this.nativeHandle + else -> KMQuad2dStretchedInstancedInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCQuad2dStretchedInstancedInterfaceProtocol.asKmp(): KMQuad2dStretchedInstancedInterface = KMQuad2dStretchedInstancedInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad3dD.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad3dD.kt new file mode 100644 index 000000000..28b9f3abd --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuad3dD.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMQuad3dD", exact = true) +actual class KMQuad3dD actual public constructor( + topLeft: KMVec3D, + topRight: KMVec3D, + bottomRight: KMVec3D, + bottomLeft: KMVec3D, +) { + actual val topLeft: KMVec3D = topLeft + actual val topRight: KMVec3D = topRight + actual val bottomRight: KMVec3D = bottomRight + actual val bottomLeft: KMVec3D = bottomLeft +} + +internal fun KMQuad3dD.asPlatform(): MapCoreSharedModule.MCQuad3dD = MapCoreSharedModule.MCQuad3dD( + topLeft = topLeft.asPlatform(), + topRight = topRight.asPlatform(), + bottomRight = bottomRight.asPlatform(), + bottomLeft = bottomLeft.asPlatform(), +) +public fun MapCoreSharedModule.MCQuad3dD.asKmp(): KMQuad3dD = KMQuad3dD( + topLeft = (this.topLeft as MapCoreSharedModule.MCVec3D).asKmp(), + topRight = (this.topRight as MapCoreSharedModule.MCVec3D).asKmp(), + bottomRight = (this.bottomRight as MapCoreSharedModule.MCVec3D).asKmp(), + bottomLeft = (this.bottomLeft as MapCoreSharedModule.MCVec3D).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuadCoord.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuadCoord.kt new file mode 100644 index 000000000..1c19d4f78 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMQuadCoord.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMQuadCoord", exact = true) +actual class KMQuadCoord actual public constructor( + topLeft: KMCoord, + topRight: KMCoord, + bottomRight: KMCoord, + bottomLeft: KMCoord, +) { + actual val topLeft: KMCoord = topLeft + actual val topRight: KMCoord = topRight + actual val bottomRight: KMCoord = bottomRight + actual val bottomLeft: KMCoord = bottomLeft +} + +internal fun KMQuadCoord.asPlatform(): MapCoreSharedModule.MCQuadCoord = MapCoreSharedModule.MCQuadCoord( + topLeft = topLeft.asPlatform(), + topRight = topRight.asPlatform(), + bottomRight = bottomRight.asPlatform(), + bottomLeft = bottomLeft.asPlatform(), +) +public fun MapCoreSharedModule.MCQuadCoord.asKmp(): KMQuadCoord = KMQuadCoord( + topLeft = (this.topLeft as MapCoreSharedModule.MCCoord).asKmp(), + topRight = (this.topRight as MapCoreSharedModule.MCCoord).asKmp(), + bottomRight = (this.bottomRight as MapCoreSharedModule.MCCoord).asKmp(), + bottomLeft = (this.bottomLeft as MapCoreSharedModule.MCCoord).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderInterface.kt new file mode 100644 index 000000000..ba4f0bc3f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderInterface.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRasterShaderInterface", exact = true) +actual class KMRasterShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCRasterShaderInterfaceProtocol + + actual fun setStyle(style: KMRasterShaderStyle) { + native.setStyle(style.asPlatform()) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } +} + +internal fun KMRasterShaderInterface.asPlatform(): MapCoreSharedModule.MCRasterShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCRasterShaderInterfaceProtocol +public fun MapCoreSharedModule.MCRasterShaderInterfaceProtocol.asKmp(): KMRasterShaderInterface = KMRasterShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderStyle.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderStyle.kt new file mode 100644 index 000000000..3797bc2f6 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRasterShaderStyle.kt @@ -0,0 +1,48 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRasterShaderStyle", exact = true) +actual class KMRasterShaderStyle actual public constructor( + opacity: Float, + brightnessMin: Float, + brightnessMax: Float, + contrast: Float, + saturation: Float, + gamma: Float, + brightnessShift: Float, +) { + actual val opacity: Float = opacity + actual val brightnessMin: Float = brightnessMin + actual val brightnessMax: Float = brightnessMax + actual val contrast: Float = contrast + actual val saturation: Float = saturation + actual val gamma: Float = gamma + actual val brightnessShift: Float = brightnessShift +} + +internal fun KMRasterShaderStyle.asPlatform(): MapCoreSharedModule.MCRasterShaderStyle = MapCoreSharedModule.MCRasterShaderStyle( + opacity = opacity, + brightnessMin = brightnessMin, + brightnessMax = brightnessMax, + contrast = contrast, + saturation = saturation, + gamma = gamma, + brightnessShift = brightnessShift, +) +public fun MapCoreSharedModule.MCRasterShaderStyle.asKmp(): KMRasterShaderStyle = KMRasterShaderStyle( + opacity = this.opacity, + brightnessMin = this.brightnessMin, + brightnessMax = this.brightnessMax, + contrast = this.contrast, + saturation = this.saturation, + gamma = this.gamma, + brightnessShift = this.brightnessShift, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectCoord.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectCoord.kt new file mode 100644 index 000000000..1d700125c --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectCoord.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from coordinate_system.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRectCoord", exact = true) +actual class KMRectCoord actual public constructor( + topLeft: KMCoord, + bottomRight: KMCoord, +) { + actual val topLeft: KMCoord = topLeft + actual val bottomRight: KMCoord = bottomRight +} + +internal fun KMRectCoord.asPlatform(): MapCoreSharedModule.MCRectCoord = MapCoreSharedModule.MCRectCoord( + topLeft = topLeft.asPlatform(), + bottomRight = bottomRight.asPlatform(), +) +public fun MapCoreSharedModule.MCRectCoord.asKmp(): KMRectCoord = KMRectCoord( + topLeft = (this.topLeft as MapCoreSharedModule.MCCoord).asKmp(), + bottomRight = (this.bottomRight as MapCoreSharedModule.MCCoord).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectD.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectD.kt new file mode 100644 index 000000000..ae8b55aa7 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectD.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRectD", exact = true) +actual class KMRectD actual public constructor( + x: Double, + y: Double, + width: Double, + height: Double, +) { + actual val x: Double = x + actual val y: Double = y + actual val width: Double = width + actual val height: Double = height +} + +internal fun KMRectD.asPlatform(): MapCoreSharedModule.MCRectD = MapCoreSharedModule.MCRectD( + x = x, + y = y, + width = width, + height = height, +) +public fun MapCoreSharedModule.MCRectD.asKmp(): KMRectD = KMRectD( + x = this.x, + y = this.y, + width = this.width, + height = this.height, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectF.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectF.kt new file mode 100644 index 000000000..ba65ffc91 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectF.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRectF", exact = true) +actual class KMRectF actual public constructor( + x: Float, + y: Float, + width: Float, + height: Float, +) { + actual val x: Float = x + actual val y: Float = y + actual val width: Float = width + actual val height: Float = height +} + +internal fun KMRectF.asPlatform(): MapCoreSharedModule.MCRectF = MapCoreSharedModule.MCRectF( + x = x, + y = y, + width = width, + height = height, +) +public fun MapCoreSharedModule.MCRectF.asKmp(): KMRectF = KMRectF( + x = this.x, + y = this.y, + width = this.width, + height = this.height, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectI.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectI.kt new file mode 100644 index 000000000..b8c4fbe2f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectI.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRectI", exact = true) +actual class KMRectI actual public constructor( + x: Int, + y: Int, + width: Int, + height: Int, +) { + actual val x: Int = x + actual val y: Int = y + actual val width: Int = width + actual val height: Int = height +} + +internal fun KMRectI.asPlatform(): MapCoreSharedModule.MCRectI = MapCoreSharedModule.MCRectI( + x = x, + y = y, + width = width, + height = height, +) +public fun MapCoreSharedModule.MCRectI.asKmp(): KMRectI = KMRectI( + x = this.x, + y = this.y, + width = this.width, + height = this.height, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePacker.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePacker.kt new file mode 100644 index 000000000..2a34f3c9f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePacker.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from packer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRectanglePacker", exact = true) +actual class KMRectanglePacker actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCRectanglePacker + + actual companion object + { + + actual fun pack(rectangles: HashMap, maxPageSize: KMVec2I, spacing: Int): ArrayList { + val result = MapCoreSharedModule.MCRectanglePacker.pack(HashMap(rectangles.map { it.key to it.value.asPlatform() }.toMap()), maxPageSize.asPlatform(), spacing) + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCRectanglePackerPage).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCRectanglePackerPage).asKmp() })) + } + } +} + +internal fun KMRectanglePacker.asPlatform(): MapCoreSharedModule.MCRectanglePacker = nativeHandle as MapCoreSharedModule.MCRectanglePacker +public fun MapCoreSharedModule.MCRectanglePacker.asKmp(): KMRectanglePacker = KMRectanglePacker(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePackerPage.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePackerPage.kt new file mode 100644 index 000000000..c0653ebd6 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRectanglePackerPage.kt @@ -0,0 +1,24 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from packer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRectanglePackerPage", exact = true) +actual class KMRectanglePackerPage actual public constructor( + uvs: HashMap, +) { + actual val uvs: HashMap = uvs +} + +internal fun KMRectanglePackerPage.asPlatform(): MapCoreSharedModule.MCRectanglePackerPage = MapCoreSharedModule.MCRectanglePackerPage( + uvs = HashMap(uvs.map { it.key to it.value.asPlatform() }.toMap()), +) +public fun MapCoreSharedModule.MCRectanglePackerPage.asKmp(): KMRectanglePackerPage = KMRectanglePackerPage( + uvs = HashMap(((this.uvs as? Map<*, *>)?.map { (it.key as String) to (it.value as MapCoreSharedModule.MCRectI).asKmp() }?.toMap() ?: run { val e = (this.uvs as platform.Foundation.NSDictionary).keyEnumerator(); generateSequence { e.nextObject() }.associate { key -> (key as String) to ((this.uvs as platform.Foundation.NSDictionary).objectForKey(key) as MapCoreSharedModule.MCRectI).asKmp() } })), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderConfigInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderConfigInterface.kt new file mode 100644 index 000000000..6dc97641b --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderConfigInterface.kt @@ -0,0 +1,31 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from layer_object.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRenderConfigInterface", exact = true) +actual class KMRenderConfigInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCRenderConfigInterface + + actual fun getGraphicsObject(): KMGraphicsObjectInterface { + val result = native.getGraphicsObject() + return (result as MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol).asKmp() + } + + actual fun getRenderIndex(): Int { + val result = native.getRenderIndex() + return result + } +} + +internal fun KMRenderConfigInterface.asPlatform(): MapCoreSharedModule.MCRenderConfigInterface = nativeHandle as MapCoreSharedModule.MCRenderConfigInterface +public fun MapCoreSharedModule.MCRenderConfigInterface.asKmp(): KMRenderConfigInterface = KMRenderConfigInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderLineDescription.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderLineDescription.kt new file mode 100644 index 000000000..845026715 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderLineDescription.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRenderLineDescription", exact = true) +actual class KMRenderLineDescription actual public constructor( + positions: ArrayList, + styleIndex: Int, +) { + actual val positions: ArrayList = positions + actual val styleIndex: Int = styleIndex +} + +internal fun KMRenderLineDescription.asPlatform(): MapCoreSharedModule.MCRenderLineDescription = MapCoreSharedModule.MCRenderLineDescription( + positions = ArrayList(positions.map { it.asPlatform() }), + styleIndex = styleIndex, +) +public fun MapCoreSharedModule.MCRenderLineDescription.asKmp(): KMRenderLineDescription = KMRenderLineDescription( + positions = ArrayList(((this.positions as? List<*>)?.map { (it as MapCoreSharedModule.MCVec2D).asKmp() } ?: (0 until (this.positions as platform.Foundation.NSArray).count.toInt()).map { idx -> ((this.positions as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCVec2D).asKmp() })), + styleIndex = this.styleIndex, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderObjectInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderObjectInterface.kt new file mode 100644 index 000000000..21427d67e --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderObjectInterface.kt @@ -0,0 +1,100 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRenderObjectInterface", exact = true) +actual interface KMRenderObjectInterface +{ + + actual fun getGraphicsObject(): KMGraphicsObjectInterface + + actual fun hasCustomModelMatrix(): Boolean + + actual fun isScreenSpaceCoords(): Boolean + + actual fun getCustomModelMatrix(): ArrayList + + actual fun setHidden(hidden: Boolean) + + actual fun isHidden(): Boolean +} + +private class KMRenderObjectInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCRenderObjectInterfaceProtocol) : KMRenderObjectInterface +{ + + override fun getGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.getGraphicsObject() + return (result as MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol).asKmp() + } + + override fun hasCustomModelMatrix(): Boolean { + val result = nativeHandle.hasCustomModelMatrix() + return result + } + + override fun isScreenSpaceCoords(): Boolean { + val result = nativeHandle.isScreenSpaceCoords() + return result + } + + override fun getCustomModelMatrix(): ArrayList { + val result = nativeHandle.getCustomModelMatrix() + return ArrayList(((result as? List<*>)?.map { (it as platform.Foundation.NSNumber).floatValue } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as platform.Foundation.NSNumber).floatValue })) + } + + override fun setHidden(hidden: Boolean) { + nativeHandle.setHidden(hidden) + } + + override fun isHidden(): Boolean { + val result = nativeHandle.isHidden() + return result + } +} + +private class KMRenderObjectInterfacePlatformProxy(private val delegate: KMRenderObjectInterface) : NSObject(), MapCoreSharedModule.MCRenderObjectInterfaceProtocol +{ + + override fun getGraphicsObject(): MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol? { + val result = delegate.getGraphicsObject() + return result.asPlatform() + } + + override fun hasCustomModelMatrix(): Boolean { + val result = delegate.hasCustomModelMatrix() + return result + } + + override fun isScreenSpaceCoords(): Boolean { + val result = delegate.isScreenSpaceCoords() + return result + } + + override fun getCustomModelMatrix(): List<*> { + val result = delegate.getCustomModelMatrix() + return ArrayList(result.map { platform.Foundation.NSNumber(float = it) }) + } + + override fun setHidden(hidden: Boolean) { + delegate.setHidden(hidden) + } + + override fun isHidden(): Boolean { + val result = delegate.isHidden() + return result + } +} + +internal fun KMRenderObjectInterface.asPlatform(): MapCoreSharedModule.MCRenderObjectInterfaceProtocol = when (this) { + is KMRenderObjectInterfacePlatformWrapper -> this.nativeHandle + else -> KMRenderObjectInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCRenderObjectInterfaceProtocol.asKmp(): KMRenderObjectInterface = KMRenderObjectInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassConfig.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassConfig.kt new file mode 100644 index 000000000..329a576b2 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassConfig.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRenderPassConfig", exact = true) +actual class KMRenderPassConfig actual public constructor( + renderPassIndex: Int, + isPassMasked: Boolean, + renderTarget: KMRenderTargetInterface?, +) { + actual val renderPassIndex: Int = renderPassIndex + actual val isPassMasked: Boolean = isPassMasked + actual val renderTarget: KMRenderTargetInterface? = renderTarget +} + +internal fun KMRenderPassConfig.asPlatform(): MapCoreSharedModule.MCRenderPassConfig = MapCoreSharedModule.MCRenderPassConfig( + renderPassIndex = renderPassIndex, + isPassMasked = isPassMasked, + renderTarget = renderTarget?.let { it.asPlatform() }, +) +public fun MapCoreSharedModule.MCRenderPassConfig.asKmp(): KMRenderPassConfig = KMRenderPassConfig( + renderPassIndex = this.renderPassIndex, + isPassMasked = this.isPassMasked, + renderTarget = this.renderTarget?.let { (it as MapCoreSharedModule.MCRenderTargetInterfaceProtocol).asKmp() }, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassInterface.kt new file mode 100644 index 000000000..78a85c123 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderPassInterface.kt @@ -0,0 +1,88 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRenderPassInterface", exact = true) +actual interface KMRenderPassInterface +{ + + actual fun getRenderObjects(): ArrayList + + actual fun addRenderObject(renderObject: KMRenderObjectInterface) + + actual fun getRenderPassConfig(): KMRenderPassConfig + + actual fun getMaskingObject(): KMMaskingObjectInterface? + + actual fun getScissoringRect(): KMRectI? +} + +private class KMRenderPassInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCRenderPassInterfaceProtocol) : KMRenderPassInterface +{ + + override fun getRenderObjects(): ArrayList { + val result = nativeHandle.getRenderObjects() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCRenderObjectInterfaceProtocol).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCRenderObjectInterfaceProtocol).asKmp() })) + } + + override fun addRenderObject(renderObject: KMRenderObjectInterface) { + nativeHandle.addRenderObject(renderObject.asPlatform()) + } + + override fun getRenderPassConfig(): KMRenderPassConfig { + val result = nativeHandle.getRenderPassConfig() + return (result as MapCoreSharedModule.MCRenderPassConfig).asKmp() + } + + override fun getMaskingObject(): KMMaskingObjectInterface? { + val result = nativeHandle.getMaskingObject() + return result?.let { (it as MapCoreSharedModule.MCMaskingObjectInterfaceProtocol).asKmp() } + } + + override fun getScissoringRect(): KMRectI? { + val result = nativeHandle.getScissoringRect() + return result?.let { (it as MapCoreSharedModule.MCRectI).asKmp() } + } +} + +private class KMRenderPassInterfacePlatformProxy(private val delegate: KMRenderPassInterface) : NSObject(), MapCoreSharedModule.MCRenderPassInterfaceProtocol +{ + + override fun getRenderObjects(): List<*> { + val result = delegate.getRenderObjects() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun addRenderObject(renderObject: MapCoreSharedModule.MCRenderObjectInterfaceProtocol?) { + delegate.addRenderObject((renderObject as MapCoreSharedModule.MCRenderObjectInterfaceProtocol).asKmp()) + } + + override fun getRenderPassConfig(): MapCoreSharedModule.MCRenderPassConfig { + val result = delegate.getRenderPassConfig() + return result.asPlatform() + } + + override fun getMaskingObject(): MapCoreSharedModule.MCMaskingObjectInterfaceProtocol? { + val result = delegate.getMaskingObject() + return result?.let { it.asPlatform() } + } + + override fun getScissoringRect(): MapCoreSharedModule.MCRectI? { + val result = delegate.getScissoringRect() + return result?.let { it.asPlatform() } + } +} + +internal fun KMRenderPassInterface.asPlatform(): MapCoreSharedModule.MCRenderPassInterfaceProtocol = when (this) { + is KMRenderPassInterfacePlatformWrapper -> this.nativeHandle + else -> KMRenderPassInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCRenderPassInterfaceProtocol.asKmp(): KMRenderPassInterface = KMRenderPassInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderTargetInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderTargetInterface.kt new file mode 100644 index 000000000..0348af4e3 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderTargetInterface.kt @@ -0,0 +1,42 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRenderTargetInterface", exact = true) +actual interface KMRenderTargetInterface +{ + + actual fun asGlRenderTargetInterface(): KMOpenGlRenderTargetInterface? +} + +private class KMRenderTargetInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCRenderTargetInterfaceProtocol) : KMRenderTargetInterface +{ + + override fun asGlRenderTargetInterface(): KMOpenGlRenderTargetInterface? { + val result = nativeHandle.asGlRenderTargetInterface() + return result?.let { (it as MapCoreSharedModule.MCOpenGlRenderTargetInterfaceProtocol).asKmp() } + } +} + +private class KMRenderTargetInterfacePlatformProxy(private val delegate: KMRenderTargetInterface) : NSObject(), MapCoreSharedModule.MCRenderTargetInterfaceProtocol +{ + + override fun asGlRenderTargetInterface(): MapCoreSharedModule.MCOpenGlRenderTargetInterfaceProtocol? { + val result = delegate.asGlRenderTargetInterface() + return result?.let { it.asPlatform() } + } +} + +internal fun KMRenderTargetInterface.asPlatform(): MapCoreSharedModule.MCRenderTargetInterfaceProtocol = when (this) { + is KMRenderTargetInterfacePlatformWrapper -> this.nativeHandle + else -> KMRenderTargetInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCRenderTargetInterfaceProtocol.asKmp(): KMRenderTargetInterface = KMRenderTargetInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderVerticesDescription.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderVerticesDescription.kt new file mode 100644 index 000000000..0846f20ca --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderVerticesDescription.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRenderVerticesDescription", exact = true) +actual class KMRenderVerticesDescription actual public constructor( + vertices: ArrayList, + styleIndex: Int, +) { + actual val vertices: ArrayList = vertices + actual val styleIndex: Int = styleIndex +} + +internal fun KMRenderVerticesDescription.asPlatform(): MapCoreSharedModule.MCRenderVerticesDescription = MapCoreSharedModule.MCRenderVerticesDescription( + vertices = ArrayList(vertices.map { it.asPlatform() }), + styleIndex = styleIndex, +) +public fun MapCoreSharedModule.MCRenderVerticesDescription.asKmp(): KMRenderVerticesDescription = KMRenderVerticesDescription( + vertices = ArrayList(((this.vertices as? List<*>)?.map { (it as MapCoreSharedModule.MCVec2D).asKmp() } ?: (0 until (this.vertices as platform.Foundation.NSArray).count.toInt()).map { idx -> ((this.vertices as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCVec2D).asKmp() })), + styleIndex = this.styleIndex, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRendererInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRendererInterface.kt new file mode 100644 index 000000000..e77a3919b --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRendererInterface.kt @@ -0,0 +1,70 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRendererInterface", exact = true) +actual interface KMRendererInterface +{ + + actual fun addToRenderQueue(renderPass: KMRenderPassInterface) + + actual fun addToComputeQueue(computePass: KMComputePassInterface) + + actual fun drawFrame(renderingContext: KMRenderingContextInterface, camera: KMCameraInterface, target: KMRenderTargetInterface?) + + actual fun compute(renderingContext: KMRenderingContextInterface, camera: KMCameraInterface) +} + +private class KMRendererInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCRendererInterfaceProtocol) : KMRendererInterface +{ + + override fun addToRenderQueue(renderPass: KMRenderPassInterface) { + nativeHandle.addToRenderQueue(renderPass.asPlatform()) + } + + override fun addToComputeQueue(computePass: KMComputePassInterface) { + nativeHandle.addToComputeQueue(computePass.asPlatform()) + } + + override fun drawFrame(renderingContext: KMRenderingContextInterface, camera: KMCameraInterface, target: KMRenderTargetInterface?) { + nativeHandle.drawFrame(renderingContext.asPlatform(), camera.asPlatform(), target?.let { it.asPlatform() }) + } + + override fun compute(renderingContext: KMRenderingContextInterface, camera: KMCameraInterface) { + nativeHandle.compute(renderingContext.asPlatform(), camera.asPlatform()) + } +} + +private class KMRendererInterfacePlatformProxy(private val delegate: KMRendererInterface) : NSObject(), MapCoreSharedModule.MCRendererInterfaceProtocol +{ + + override fun addToRenderQueue(renderPass: MapCoreSharedModule.MCRenderPassInterfaceProtocol?) { + delegate.addToRenderQueue((renderPass as MapCoreSharedModule.MCRenderPassInterfaceProtocol).asKmp()) + } + + override fun addToComputeQueue(computePass: MapCoreSharedModule.MCComputePassInterfaceProtocol?) { + delegate.addToComputeQueue((computePass as MapCoreSharedModule.MCComputePassInterfaceProtocol).asKmp()) + } + + override fun drawFrame(renderingContext: MapCoreSharedModule.MCRenderingContextInterfaceProtocol?, camera: MapCoreSharedModule.MCCameraInterfaceProtocol?, target: MapCoreSharedModule.MCRenderTargetInterfaceProtocol?) { + delegate.drawFrame((renderingContext as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp(), (camera as MapCoreSharedModule.MCCameraInterfaceProtocol).asKmp(), target?.let { (it as MapCoreSharedModule.MCRenderTargetInterfaceProtocol).asKmp() }) + } + + override fun compute(renderingContext: MapCoreSharedModule.MCRenderingContextInterfaceProtocol?, camera: MapCoreSharedModule.MCCameraInterfaceProtocol?) { + delegate.compute((renderingContext as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp(), (camera as MapCoreSharedModule.MCCameraInterfaceProtocol).asKmp()) + } +} + +internal fun KMRendererInterface.asPlatform(): MapCoreSharedModule.MCRendererInterfaceProtocol = when (this) { + is KMRendererInterfacePlatformWrapper -> this.nativeHandle + else -> KMRendererInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCRendererInterfaceProtocol.asKmp(): KMRendererInterface = KMRendererInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingContextInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingContextInterface.kt new file mode 100644 index 000000000..24a02f585 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingContextInterface.kt @@ -0,0 +1,134 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRenderingContextInterface", exact = true) +actual interface KMRenderingContextInterface +{ + + actual fun onSurfaceCreated() + + actual fun setViewportSize(size: KMVec2I) + + actual fun getViewportSize(): KMVec2I + + actual fun setBackgroundColor(color: KMColor) + + actual fun setCulling(mode: KMRenderingCullMode) + + actual fun setupDrawFrame(vpMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double) + + actual fun preRenderStencilMask() + + actual fun postRenderStencilMask() + + actual fun applyScissorRect(scissorRect: KMRectI?) + + actual fun asOpenGlRenderingContext(): KMOpenGlRenderingContextInterface? +} + +private class KMRenderingContextInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCRenderingContextInterfaceProtocol) : KMRenderingContextInterface +{ + + override fun onSurfaceCreated() { + nativeHandle.onSurfaceCreated() + } + + override fun setViewportSize(size: KMVec2I) { + nativeHandle.setViewportSize(size.asPlatform()) + } + + override fun getViewportSize(): KMVec2I { + val result = nativeHandle.getViewportSize() + return (result as MapCoreSharedModule.MCVec2I).asKmp() + } + + override fun setBackgroundColor(color: KMColor) { + nativeHandle.setBackgroundColor(color.asPlatform()) + } + + override fun setCulling(mode: KMRenderingCullMode) { + nativeHandle.setCulling(mode.asPlatform()) + } + + override fun setupDrawFrame(vpMatrix: Long, origin: KMVec3D, screenPixelAsRealMeterFactor: Double) { + nativeHandle.setupDrawFrame(vpMatrix, origin.asPlatform(), screenPixelAsRealMeterFactor) + } + + override fun preRenderStencilMask() { + nativeHandle.preRenderStencilMask() + } + + override fun postRenderStencilMask() { + nativeHandle.postRenderStencilMask() + } + + override fun applyScissorRect(scissorRect: KMRectI?) { + nativeHandle.applyScissorRect(scissorRect?.let { it.asPlatform() }) + } + + override fun asOpenGlRenderingContext(): KMOpenGlRenderingContextInterface? { + val result = nativeHandle.asOpenGlRenderingContext() + return result?.let { (it as MapCoreSharedModule.MCOpenGlRenderingContextInterfaceProtocol).asKmp() } + } +} + +private class KMRenderingContextInterfacePlatformProxy(private val delegate: KMRenderingContextInterface) : NSObject(), MapCoreSharedModule.MCRenderingContextInterfaceProtocol +{ + + override fun onSurfaceCreated() { + delegate.onSurfaceCreated() + } + + override fun setViewportSize(size: MapCoreSharedModule.MCVec2I) { + delegate.setViewportSize((size as MapCoreSharedModule.MCVec2I).asKmp()) + } + + override fun getViewportSize(): MapCoreSharedModule.MCVec2I { + val result = delegate.getViewportSize() + return result.asPlatform() + } + + override fun setBackgroundColor(color: MapCoreSharedModule.MCColor) { + delegate.setBackgroundColor((color as MapCoreSharedModule.MCColor).asKmp()) + } + + override fun setCulling(mode: MapCoreSharedModule.MCRenderingCullMode) { + delegate.setCulling(KMRenderingCullMode.fromPlatform((mode as MapCoreSharedModule.MCRenderingCullMode))) + } + + override fun setupDrawFrame(vpMatrix: Long, origin: MapCoreSharedModule.MCVec3D, screenPixelAsRealMeterFactor: Double) { + delegate.setupDrawFrame(vpMatrix, (origin as MapCoreSharedModule.MCVec3D).asKmp(), screenPixelAsRealMeterFactor) + } + + override fun preRenderStencilMask() { + delegate.preRenderStencilMask() + } + + override fun postRenderStencilMask() { + delegate.postRenderStencilMask() + } + + override fun applyScissorRect(scissorRect: MapCoreSharedModule.MCRectI?) { + delegate.applyScissorRect(scissorRect?.let { (it as MapCoreSharedModule.MCRectI).asKmp() }) + } + + override fun asOpenGlRenderingContext(): MapCoreSharedModule.MCOpenGlRenderingContextInterfaceProtocol? { + val result = delegate.asOpenGlRenderingContext() + return result?.let { it.asPlatform() } + } +} + +internal fun KMRenderingContextInterface.asPlatform(): MapCoreSharedModule.MCRenderingContextInterfaceProtocol = when (this) { + is KMRenderingContextInterfacePlatformWrapper -> this.nativeHandle + else -> KMRenderingContextInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCRenderingContextInterfaceProtocol.asKmp(): KMRenderingContextInterface = KMRenderingContextInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingCullMode.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingCullMode.kt new file mode 100644 index 000000000..e5a5d0b35 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMRenderingCullMode.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMRenderingCullMode", exact = true) +actual enum class KMRenderingCullMode(val rawValue: Long) { + FRONT(0L), + BACK(1L), + NONE(2L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCRenderingCullMode): KMRenderingCullMode { + val raw: Long = value + return when (raw) { + 0L -> KMRenderingCullMode.FRONT + 1L -> KMRenderingCullMode.BACK + 2L -> KMRenderingCullMode.NONE + else -> throw IllegalArgumentException("Unknown KMRenderingCullMode value: " + raw) + } + } + } +} + +internal fun KMRenderingCullMode.asPlatform(): MapCoreSharedModule.MCRenderingCullMode = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMReverseGeocoderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMReverseGeocoderInterface.kt new file mode 100644 index 000000000..490ad9c32 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMReverseGeocoderInterface.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from reverse_geocoder.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMReverseGeocoderInterface", exact = true) +actual class KMReverseGeocoderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCReverseGeocoderInterface + + actual fun reverseGeocode(coord: KMCoord, thresholdMeters: Long): ArrayList { + val result = native.reverseGeocode(coord.asPlatform(), thresholdMeters) + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCVectorLayerFeatureCoordInfo).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCVectorLayerFeatureCoordInfo).asKmp() })) + } + + actual fun reverseGeocodeClosest(coord: KMCoord, thresholdMeters: Long): KMVectorLayerFeatureCoordInfo? { + val result = native.reverseGeocodeClosest(coord.asPlatform(), thresholdMeters) + return result?.let { (it as MapCoreSharedModule.MCVectorLayerFeatureCoordInfo).asKmp() } + } + + actual companion object + { + + actual fun create(loader: KMLoaderInterface, tileUrlTemplate: String, zoomLevel: Int): KMReverseGeocoderInterface { + val result = MapCoreSharedModule.MCReverseGeocoderInterface.create(loader.asPlatform(), tileUrlTemplate, zoomLevel) + return (result as MapCoreSharedModule.MCReverseGeocoderInterface).asKmp() + } + } +} + +internal fun KMReverseGeocoderInterface.asPlatform(): MapCoreSharedModule.MCReverseGeocoderInterface = nativeHandle as MapCoreSharedModule.MCReverseGeocoderInterface +public fun MapCoreSharedModule.MCReverseGeocoderInterface.asKmp(): KMReverseGeocoderInterface = KMReverseGeocoderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneCallbackInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneCallbackInterface.kt new file mode 100644 index 000000000..f45bf4a37 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneCallbackInterface.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMSceneCallbackInterface", exact = true) +actual interface KMSceneCallbackInterface +{ + + actual fun invalidate() +} + +private class KMSceneCallbackInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCSceneCallbackInterfaceProtocol) : KMSceneCallbackInterface +{ + + override fun invalidate() { + nativeHandle.invalidate() + } +} + +private class KMSceneCallbackInterfacePlatformProxy(private val delegate: KMSceneCallbackInterface) : NSObject(), MapCoreSharedModule.MCSceneCallbackInterfaceProtocol +{ + + override fun invalidate() { + delegate.invalidate() + } +} + +internal fun KMSceneCallbackInterface.asPlatform(): MapCoreSharedModule.MCSceneCallbackInterfaceProtocol = when (this) { + is KMSceneCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMSceneCallbackInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCSceneCallbackInterfaceProtocol.asKmp(): KMSceneCallbackInterface = KMSceneCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneInterface.kt new file mode 100644 index 000000000..b3e581988 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSceneInterface.kt @@ -0,0 +1,88 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from core.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMSceneInterface", exact = true) +actual class KMSceneInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCSceneInterface + + actual fun setCallbackHandler(callbackInterface: KMSceneCallbackInterface) { + native.setCallbackHandler(callbackInterface.asPlatform()) + } + + actual fun setCamera(camera: KMCameraInterface) { + native.setCamera(camera.asPlatform()) + } + + actual fun getCamera(): KMCameraInterface { + val result = native.getCamera() + return (result as MapCoreSharedModule.MCCameraInterfaceProtocol).asKmp() + } + + actual fun getRenderer(): KMRendererInterface { + val result = native.getRenderer() + return (result as MapCoreSharedModule.MCRendererInterfaceProtocol).asKmp() + } + + actual fun getRenderingContext(): KMRenderingContextInterface { + val result = native.getRenderingContext() + return (result as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp() + } + + actual fun getGraphicsFactory(): KMGraphicsObjectFactoryInterface { + val result = native.getGraphicsFactory() + return (result as MapCoreSharedModule.MCGraphicsObjectFactoryInterfaceProtocol).asKmp() + } + + actual fun getShaderFactory(): KMShaderFactoryInterface { + val result = native.getShaderFactory() + return (result as MapCoreSharedModule.MCShaderFactoryInterfaceProtocol).asKmp() + } + + actual fun prepare() { + native.prepare() + } + + actual fun drawFrame(target: KMRenderTargetInterface?) { + native.drawFrame(target?.let { it.asPlatform() }) + } + + actual fun compute() { + native.compute() + } + + actual fun clear() { + native.clear() + } + + actual fun invalidate() { + native.invalidate() + } + + actual companion object + { + + actual fun create(graphicsFactory: KMGraphicsObjectFactoryInterface, shaderFactory: KMShaderFactoryInterface, renderingContext: KMRenderingContextInterface): KMSceneInterface { + val result = MapCoreSharedModule.MCSceneInterface.create(graphicsFactory.asPlatform(), shaderFactory.asPlatform(), renderingContext.asPlatform()) + return (result as MapCoreSharedModule.MCSceneInterface).asKmp() + } + + actual fun createWithOpenGl(): KMSceneInterface { + val result = MapCoreSharedModule.MCSceneInterface.createWithOpenGl() + return (result as MapCoreSharedModule.MCSceneInterface).asKmp() + } + } +} + +internal fun KMSceneInterface.asPlatform(): MapCoreSharedModule.MCSceneInterface = nativeHandle as MapCoreSharedModule.MCSceneInterface +public fun MapCoreSharedModule.MCSceneInterface.asKmp(): KMSceneInterface = KMSceneInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerGraphicsTaskCallbacks.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerGraphicsTaskCallbacks.kt new file mode 100644 index 000000000..c8f4d951e --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerGraphicsTaskCallbacks.kt @@ -0,0 +1,25 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMSchedulerGraphicsTaskCallbacks", exact = true) +actual class KMSchedulerGraphicsTaskCallbacks actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCSchedulerGraphicsTaskCallbacks + + actual fun requestGraphicsTaskExecution() { + native.requestGraphicsTaskExecution() + } +} + +internal fun KMSchedulerGraphicsTaskCallbacks.asPlatform(): MapCoreSharedModule.MCSchedulerGraphicsTaskCallbacks = nativeHandle as MapCoreSharedModule.MCSchedulerGraphicsTaskCallbacks +public fun MapCoreSharedModule.MCSchedulerGraphicsTaskCallbacks.asKmp(): KMSchedulerGraphicsTaskCallbacks = KMSchedulerGraphicsTaskCallbacks(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerInterface.kt new file mode 100644 index 000000000..ee18093f6 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSchedulerInterface.kt @@ -0,0 +1,134 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMSchedulerInterface", exact = true) +actual interface KMSchedulerInterface +{ + + actual fun addTask(task: KMTaskInterface) + + actual fun addTasks(tasks: ArrayList) + + actual fun removeTask(id: String) + + actual fun clear() + + actual fun pause() + + actual fun resume() + + actual fun destroy() + + actual fun hasSeparateGraphicsInvocation(): Boolean + + actual fun runGraphicsTasks(): Boolean + + actual fun setSchedulerGraphicsTaskCallbacks(callbacks: KMSchedulerGraphicsTaskCallbacks) +} + +private class KMSchedulerInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCSchedulerInterfaceProtocol) : KMSchedulerInterface +{ + + override fun addTask(task: KMTaskInterface) { + nativeHandle.addTask(task.asPlatform()) + } + + override fun addTasks(tasks: ArrayList) { + nativeHandle.addTasks(ArrayList(tasks.map { it.asPlatform() })) + } + + override fun removeTask(id: String) { + nativeHandle.removeTask(id) + } + + override fun clear() { + nativeHandle.clear() + } + + override fun pause() { + nativeHandle.pause() + } + + override fun resume() { + nativeHandle.resume() + } + + override fun destroy() { + nativeHandle.destroy() + } + + override fun hasSeparateGraphicsInvocation(): Boolean { + val result = nativeHandle.hasSeparateGraphicsInvocation() + return result + } + + override fun runGraphicsTasks(): Boolean { + val result = nativeHandle.runGraphicsTasks() + return result + } + + override fun setSchedulerGraphicsTaskCallbacks(callbacks: KMSchedulerGraphicsTaskCallbacks) { + nativeHandle.setSchedulerGraphicsTaskCallbacks(callbacks.asPlatform()) + } +} + +private class KMSchedulerInterfacePlatformProxy(private val delegate: KMSchedulerInterface) : NSObject(), MapCoreSharedModule.MCSchedulerInterfaceProtocol +{ + + override fun addTask(task: MapCoreSharedModule.MCTaskInterfaceProtocol?) { + delegate.addTask((task as MapCoreSharedModule.MCTaskInterfaceProtocol).asKmp()) + } + + override fun addTasks(tasks: List<*>) { + delegate.addTasks(ArrayList(((tasks as? List<*>)?.map { (it as MapCoreSharedModule.MCTaskInterfaceProtocol).asKmp() } ?: (0 until (tasks as platform.Foundation.NSArray).count.toInt()).map { idx -> ((tasks as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCTaskInterfaceProtocol).asKmp() }))) + } + + override fun removeTask(id: String) { + delegate.removeTask(id) + } + + override fun clear() { + delegate.clear() + } + + override fun pause() { + delegate.pause() + } + + override fun resume() { + delegate.resume() + } + + override fun destroy() { + delegate.destroy() + } + + override fun hasSeparateGraphicsInvocation(): Boolean { + val result = delegate.hasSeparateGraphicsInvocation() + return result + } + + override fun runGraphicsTasks(): Boolean { + val result = delegate.runGraphicsTasks() + return result + } + + override fun setSchedulerGraphicsTaskCallbacks(callbacks: MapCoreSharedModule.MCSchedulerGraphicsTaskCallbacks?) { + delegate.setSchedulerGraphicsTaskCallbacks((callbacks as MapCoreSharedModule.MCSchedulerGraphicsTaskCallbacks).asKmp()) + } +} + +internal fun KMSchedulerInterface.asPlatform(): MapCoreSharedModule.MCSchedulerInterfaceProtocol = when (this) { + is KMSchedulerInterfacePlatformWrapper -> this.nativeHandle + else -> KMSchedulerInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCSchedulerInterfaceProtocol.asKmp(): KMSchedulerInterface = KMSchedulerInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderFactoryInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderFactoryInterface.kt new file mode 100644 index 000000000..b4e65c323 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderFactoryInterface.kt @@ -0,0 +1,354 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMShaderFactoryInterface", exact = true) +actual interface KMShaderFactoryInterface +{ + + actual fun createAlphaShader(): KMAlphaShaderInterface + + actual fun createUnitSphereAlphaShader(): KMAlphaShaderInterface + + actual fun createAlphaInstancedShader(): KMAlphaInstancedShaderInterface + + actual fun createUnitSphereAlphaInstancedShader(): KMAlphaInstancedShaderInterface + + actual fun createLineGroupShader(): KMLineGroupShaderInterface + + actual fun createUnitSphereLineGroupShader(): KMLineGroupShaderInterface + + actual fun createSimpleLineGroupShader(): KMLineGroupShaderInterface + + actual fun createUnitSphereSimpleLineGroupShader(): KMLineGroupShaderInterface + + actual fun createUnitSphereColorShader(): KMColorShaderInterface + + actual fun createColorShader(): KMColorShaderInterface + + actual fun createPolygonTessellatedShader(unitSphere: Boolean): KMColorShaderInterface + + actual fun createColorCircleShader(): KMColorCircleShaderInterface + + actual fun createUnitSphereColorCircleShader(): KMColorCircleShaderInterface + + actual fun createPolygonGroupShader(isStriped: Boolean, unitSphere: Boolean): KMPolygonGroupShaderInterface + + actual fun createPolygonPatternGroupShader(fadeInPattern: Boolean, unitSphere: Boolean): KMPolygonPatternGroupShaderInterface + + actual fun createTextShader(): KMTextShaderInterface + + actual fun createTextInstancedShader(): KMTextInstancedShaderInterface + + actual fun createUnitSphereTextInstancedShader(): KMTextInstancedShaderInterface + + actual fun createRasterShader(): KMRasterShaderInterface + + actual fun createUnitSphereRasterShader(): KMRasterShaderInterface + + actual fun createQuadTessellatedShader(): KMRasterShaderInterface + + actual fun createStretchShader(): KMStretchShaderInterface + + actual fun createStretchInstancedShader(unitSphere: Boolean): KMStretchInstancedShaderInterface + + actual fun createIcosahedronColorShader(): KMColorShaderInterface + + actual fun createSphereEffectShader(): KMSphereEffectShaderInterface + + actual fun createSkySphereShader(): KMSkySphereShaderInterface + + actual fun createElevationInterpolationShader(): KMElevationInterpolationShaderInterface +} + +private class KMShaderFactoryInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCShaderFactoryInterfaceProtocol) : KMShaderFactoryInterface +{ + + override fun createAlphaShader(): KMAlphaShaderInterface { + val result = nativeHandle.createAlphaShader() + return (result as MapCoreSharedModule.MCAlphaShaderInterfaceProtocol).asKmp() + } + + override fun createUnitSphereAlphaShader(): KMAlphaShaderInterface { + val result = nativeHandle.createUnitSphereAlphaShader() + return (result as MapCoreSharedModule.MCAlphaShaderInterfaceProtocol).asKmp() + } + + override fun createAlphaInstancedShader(): KMAlphaInstancedShaderInterface { + val result = nativeHandle.createAlphaInstancedShader() + return (result as MapCoreSharedModule.MCAlphaInstancedShaderInterfaceProtocol).asKmp() + } + + override fun createUnitSphereAlphaInstancedShader(): KMAlphaInstancedShaderInterface { + val result = nativeHandle.createUnitSphereAlphaInstancedShader() + return (result as MapCoreSharedModule.MCAlphaInstancedShaderInterfaceProtocol).asKmp() + } + + override fun createLineGroupShader(): KMLineGroupShaderInterface { + val result = nativeHandle.createLineGroupShader() + return (result as MapCoreSharedModule.MCLineGroupShaderInterfaceProtocol).asKmp() + } + + override fun createUnitSphereLineGroupShader(): KMLineGroupShaderInterface { + val result = nativeHandle.createUnitSphereLineGroupShader() + return (result as MapCoreSharedModule.MCLineGroupShaderInterfaceProtocol).asKmp() + } + + override fun createSimpleLineGroupShader(): KMLineGroupShaderInterface { + val result = nativeHandle.createSimpleLineGroupShader() + return (result as MapCoreSharedModule.MCLineGroupShaderInterfaceProtocol).asKmp() + } + + override fun createUnitSphereSimpleLineGroupShader(): KMLineGroupShaderInterface { + val result = nativeHandle.createUnitSphereSimpleLineGroupShader() + return (result as MapCoreSharedModule.MCLineGroupShaderInterfaceProtocol).asKmp() + } + + override fun createUnitSphereColorShader(): KMColorShaderInterface { + val result = nativeHandle.createUnitSphereColorShader() + return (result as MapCoreSharedModule.MCColorShaderInterfaceProtocol).asKmp() + } + + override fun createColorShader(): KMColorShaderInterface { + val result = nativeHandle.createColorShader() + return (result as MapCoreSharedModule.MCColorShaderInterfaceProtocol).asKmp() + } + + override fun createPolygonTessellatedShader(unitSphere: Boolean): KMColorShaderInterface { + val result = nativeHandle.createPolygonTessellatedShader(unitSphere) + return (result as MapCoreSharedModule.MCColorShaderInterfaceProtocol).asKmp() + } + + override fun createColorCircleShader(): KMColorCircleShaderInterface { + val result = nativeHandle.createColorCircleShader() + return (result as MapCoreSharedModule.MCColorCircleShaderInterfaceProtocol).asKmp() + } + + override fun createUnitSphereColorCircleShader(): KMColorCircleShaderInterface { + val result = nativeHandle.createUnitSphereColorCircleShader() + return (result as MapCoreSharedModule.MCColorCircleShaderInterfaceProtocol).asKmp() + } + + override fun createPolygonGroupShader(isStriped: Boolean, unitSphere: Boolean): KMPolygonGroupShaderInterface { + val result = nativeHandle.createPolygonGroupShader(isStriped, unitSphere) + return (result as MapCoreSharedModule.MCPolygonGroupShaderInterfaceProtocol).asKmp() + } + + override fun createPolygonPatternGroupShader(fadeInPattern: Boolean, unitSphere: Boolean): KMPolygonPatternGroupShaderInterface { + val result = nativeHandle.createPolygonPatternGroupShader(fadeInPattern, unitSphere) + return (result as MapCoreSharedModule.MCPolygonPatternGroupShaderInterfaceProtocol).asKmp() + } + + override fun createTextShader(): KMTextShaderInterface { + val result = nativeHandle.createTextShader() + return (result as MapCoreSharedModule.MCTextShaderInterfaceProtocol).asKmp() + } + + override fun createTextInstancedShader(): KMTextInstancedShaderInterface { + val result = nativeHandle.createTextInstancedShader() + return (result as MapCoreSharedModule.MCTextInstancedShaderInterfaceProtocol).asKmp() + } + + override fun createUnitSphereTextInstancedShader(): KMTextInstancedShaderInterface { + val result = nativeHandle.createUnitSphereTextInstancedShader() + return (result as MapCoreSharedModule.MCTextInstancedShaderInterfaceProtocol).asKmp() + } + + override fun createRasterShader(): KMRasterShaderInterface { + val result = nativeHandle.createRasterShader() + return (result as MapCoreSharedModule.MCRasterShaderInterfaceProtocol).asKmp() + } + + override fun createUnitSphereRasterShader(): KMRasterShaderInterface { + val result = nativeHandle.createUnitSphereRasterShader() + return (result as MapCoreSharedModule.MCRasterShaderInterfaceProtocol).asKmp() + } + + override fun createQuadTessellatedShader(): KMRasterShaderInterface { + val result = nativeHandle.createQuadTessellatedShader() + return (result as MapCoreSharedModule.MCRasterShaderInterfaceProtocol).asKmp() + } + + override fun createStretchShader(): KMStretchShaderInterface { + val result = nativeHandle.createStretchShader() + return (result as MapCoreSharedModule.MCStretchShaderInterfaceProtocol).asKmp() + } + + override fun createStretchInstancedShader(unitSphere: Boolean): KMStretchInstancedShaderInterface { + val result = nativeHandle.createStretchInstancedShader(unitSphere) + return (result as MapCoreSharedModule.MCStretchInstancedShaderInterfaceProtocol).asKmp() + } + + override fun createIcosahedronColorShader(): KMColorShaderInterface { + val result = nativeHandle.createIcosahedronColorShader() + return (result as MapCoreSharedModule.MCColorShaderInterfaceProtocol).asKmp() + } + + override fun createSphereEffectShader(): KMSphereEffectShaderInterface { + val result = nativeHandle.createSphereEffectShader() + return (result as MapCoreSharedModule.MCSphereEffectShaderInterfaceProtocol).asKmp() + } + + override fun createSkySphereShader(): KMSkySphereShaderInterface { + val result = nativeHandle.createSkySphereShader() + return (result as MapCoreSharedModule.MCSkySphereShaderInterfaceProtocol).asKmp() + } + + override fun createElevationInterpolationShader(): KMElevationInterpolationShaderInterface { + val result = nativeHandle.createElevationInterpolationShader() + return (result as MapCoreSharedModule.MCElevationInterpolationShaderInterfaceProtocol).asKmp() + } +} + +private class KMShaderFactoryInterfacePlatformProxy(private val delegate: KMShaderFactoryInterface) : NSObject(), MapCoreSharedModule.MCShaderFactoryInterfaceProtocol +{ + + override fun createAlphaShader(): MapCoreSharedModule.MCAlphaShaderInterfaceProtocol? { + val result = delegate.createAlphaShader() + return result.asPlatform() + } + + override fun createUnitSphereAlphaShader(): MapCoreSharedModule.MCAlphaShaderInterfaceProtocol? { + val result = delegate.createUnitSphereAlphaShader() + return result.asPlatform() + } + + override fun createAlphaInstancedShader(): MapCoreSharedModule.MCAlphaInstancedShaderInterfaceProtocol? { + val result = delegate.createAlphaInstancedShader() + return result.asPlatform() + } + + override fun createUnitSphereAlphaInstancedShader(): MapCoreSharedModule.MCAlphaInstancedShaderInterfaceProtocol? { + val result = delegate.createUnitSphereAlphaInstancedShader() + return result.asPlatform() + } + + override fun createLineGroupShader(): MapCoreSharedModule.MCLineGroupShaderInterfaceProtocol? { + val result = delegate.createLineGroupShader() + return result.asPlatform() + } + + override fun createUnitSphereLineGroupShader(): MapCoreSharedModule.MCLineGroupShaderInterfaceProtocol? { + val result = delegate.createUnitSphereLineGroupShader() + return result.asPlatform() + } + + override fun createSimpleLineGroupShader(): MapCoreSharedModule.MCLineGroupShaderInterfaceProtocol? { + val result = delegate.createSimpleLineGroupShader() + return result.asPlatform() + } + + override fun createUnitSphereSimpleLineGroupShader(): MapCoreSharedModule.MCLineGroupShaderInterfaceProtocol? { + val result = delegate.createUnitSphereSimpleLineGroupShader() + return result.asPlatform() + } + + override fun createUnitSphereColorShader(): MapCoreSharedModule.MCColorShaderInterfaceProtocol? { + val result = delegate.createUnitSphereColorShader() + return result.asPlatform() + } + + override fun createColorShader(): MapCoreSharedModule.MCColorShaderInterfaceProtocol? { + val result = delegate.createColorShader() + return result.asPlatform() + } + + override fun createPolygonTessellatedShader(unitSphere: Boolean): MapCoreSharedModule.MCColorShaderInterfaceProtocol? { + val result = delegate.createPolygonTessellatedShader(unitSphere) + return result.asPlatform() + } + + override fun createColorCircleShader(): MapCoreSharedModule.MCColorCircleShaderInterfaceProtocol? { + val result = delegate.createColorCircleShader() + return result.asPlatform() + } + + override fun createUnitSphereColorCircleShader(): MapCoreSharedModule.MCColorCircleShaderInterfaceProtocol? { + val result = delegate.createUnitSphereColorCircleShader() + return result.asPlatform() + } + + override fun createPolygonGroupShader(isStriped: Boolean, unitSphere: Boolean): MapCoreSharedModule.MCPolygonGroupShaderInterfaceProtocol? { + val result = delegate.createPolygonGroupShader(isStriped, unitSphere) + return result.asPlatform() + } + + override fun createPolygonPatternGroupShader(fadeInPattern: Boolean, unitSphere: Boolean): MapCoreSharedModule.MCPolygonPatternGroupShaderInterfaceProtocol? { + val result = delegate.createPolygonPatternGroupShader(fadeInPattern, unitSphere) + return result.asPlatform() + } + + override fun createTextShader(): MapCoreSharedModule.MCTextShaderInterfaceProtocol? { + val result = delegate.createTextShader() + return result.asPlatform() + } + + override fun createTextInstancedShader(): MapCoreSharedModule.MCTextInstancedShaderInterfaceProtocol? { + val result = delegate.createTextInstancedShader() + return result.asPlatform() + } + + override fun createUnitSphereTextInstancedShader(): MapCoreSharedModule.MCTextInstancedShaderInterfaceProtocol? { + val result = delegate.createUnitSphereTextInstancedShader() + return result.asPlatform() + } + + override fun createRasterShader(): MapCoreSharedModule.MCRasterShaderInterfaceProtocol? { + val result = delegate.createRasterShader() + return result.asPlatform() + } + + override fun createUnitSphereRasterShader(): MapCoreSharedModule.MCRasterShaderInterfaceProtocol? { + val result = delegate.createUnitSphereRasterShader() + return result.asPlatform() + } + + override fun createQuadTessellatedShader(): MapCoreSharedModule.MCRasterShaderInterfaceProtocol? { + val result = delegate.createQuadTessellatedShader() + return result.asPlatform() + } + + override fun createStretchShader(): MapCoreSharedModule.MCStretchShaderInterfaceProtocol? { + val result = delegate.createStretchShader() + return result.asPlatform() + } + + override fun createStretchInstancedShader(unitSphere: Boolean): MapCoreSharedModule.MCStretchInstancedShaderInterfaceProtocol? { + val result = delegate.createStretchInstancedShader(unitSphere) + return result.asPlatform() + } + + override fun createIcosahedronColorShader(): MapCoreSharedModule.MCColorShaderInterfaceProtocol? { + val result = delegate.createIcosahedronColorShader() + return result.asPlatform() + } + + override fun createSphereEffectShader(): MapCoreSharedModule.MCSphereEffectShaderInterfaceProtocol? { + val result = delegate.createSphereEffectShader() + return result.asPlatform() + } + + override fun createSkySphereShader(): MapCoreSharedModule.MCSkySphereShaderInterfaceProtocol? { + val result = delegate.createSkySphereShader() + return result.asPlatform() + } + + override fun createElevationInterpolationShader(): MapCoreSharedModule.MCElevationInterpolationShaderInterfaceProtocol? { + val result = delegate.createElevationInterpolationShader() + return result.asPlatform() + } +} + +internal fun KMShaderFactoryInterface.asPlatform(): MapCoreSharedModule.MCShaderFactoryInterfaceProtocol = when (this) { + is KMShaderFactoryInterfacePlatformWrapper -> this.nativeHandle + else -> KMShaderFactoryInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCShaderFactoryInterfaceProtocol.asKmp(): KMShaderFactoryInterface = KMShaderFactoryInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderProgramInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderProgramInterface.kt new file mode 100644 index 000000000..a5670f2c0 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMShaderProgramInterface.kt @@ -0,0 +1,43 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMShaderProgramInterface", exact = true) +actual class KMShaderProgramInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCShaderProgramInterfaceProtocol + + actual fun getProgramName(): String { + val result = native.getProgramName() + return result + } + + actual fun setupProgram(context: KMRenderingContextInterface) { + native.setupProgram(context.asPlatform()) + } + + actual fun preRender(context: KMRenderingContextInterface, isScreenSpaceCoords: Boolean) { + native.preRender(context.asPlatform(), isScreenSpaceCoords) + } + + actual fun setBlendMode(blendMode: KMBlendMode) { + native.setBlendMode(blendMode.asPlatform()) + } + + actual fun usesModelMatrix(): Boolean { + val result = native.usesModelMatrix() + return result + } +} + +internal fun KMShaderProgramInterface.asPlatform(): MapCoreSharedModule.MCShaderProgramInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCShaderProgramInterfaceProtocol +public fun MapCoreSharedModule.MCShaderProgramInterfaceProtocol.asKmp(): KMShaderProgramInterface = KMShaderProgramInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSharedBytes.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSharedBytes.kt new file mode 100644 index 000000000..15ba5c24d --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSharedBytes.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMSharedBytes", exact = true) +actual class KMSharedBytes actual public constructor( + address: Long, + elementCount: Int, + bytesPerElement: Int, +) { + actual val address: Long = address + actual val elementCount: Int = elementCount + actual val bytesPerElement: Int = bytesPerElement +} + +internal fun KMSharedBytes.asPlatform(): MapCoreSharedModule.MCSharedBytes = MapCoreSharedModule.MCSharedBytes( + address = address, + elementCount = elementCount, + bytesPerElement = bytesPerElement, +) +public fun MapCoreSharedModule.MCSharedBytes.asKmp(): KMSharedBytes = KMSharedBytes( + address = this.address, + elementCount = this.elementCount, + bytesPerElement = this.bytesPerElement, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSizeType.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSizeType.kt new file mode 100644 index 000000000..c6d1b1645 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSizeType.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from styling.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMSizeType", exact = true) +actual enum class KMSizeType(val rawValue: Long) { + SCREEN_PIXEL(0L), + MAP_UNIT(1L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCSizeType): KMSizeType { + val raw: Long = value + return when (raw) { + 0L -> KMSizeType.SCREEN_PIXEL + 1L -> KMSizeType.MAP_UNIT + else -> throw IllegalArgumentException("Unknown KMSizeType value: " + raw) + } + } + } +} + +internal fun KMSizeType.asPlatform(): MapCoreSharedModule.MCSizeType = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereLayerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereLayerInterface.kt new file mode 100644 index 000000000..c6a886dcc --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereLayerInterface.kt @@ -0,0 +1,39 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from sky_sphere.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMSkySphereLayerInterface", exact = true) +actual class KMSkySphereLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCSkySphereLayerInterface + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as MapCoreSharedModule.MCLayerInterfaceProtocol).asKmp() + } + + actual fun setTexture(texture: KMTextureHolderInterface) { + native.setTexture(texture.asPlatform()) + } + + actual companion object + { + + actual fun create(): KMSkySphereLayerInterface { + val result = MapCoreSharedModule.MCSkySphereLayerInterface.create() + return (result as MapCoreSharedModule.MCSkySphereLayerInterface).asKmp() + } + } +} + +internal fun KMSkySphereLayerInterface.asPlatform(): MapCoreSharedModule.MCSkySphereLayerInterface = nativeHandle as MapCoreSharedModule.MCSkySphereLayerInterface +public fun MapCoreSharedModule.MCSkySphereLayerInterface.asKmp(): KMSkySphereLayerInterface = KMSkySphereLayerInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereShaderInterface.kt new file mode 100644 index 000000000..ffa80ec94 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSkySphereShaderInterface.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMSkySphereShaderInterface", exact = true) +actual class KMSkySphereShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCSkySphereShaderInterfaceProtocol + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } + + actual fun setCameraProperties(inverseVP: ArrayList, cameraPosition: KMVec3D) { + native.setCameraProperties(ArrayList(inverseVP.map { platform.Foundation.NSNumber(float = it) }), cameraPosition.asPlatform()) + } +} + +internal fun KMSkySphereShaderInterface.asPlatform(): MapCoreSharedModule.MCSkySphereShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCSkySphereShaderInterfaceProtocol +public fun MapCoreSharedModule.MCSkySphereShaderInterfaceProtocol.asKmp(): KMSkySphereShaderInterface = KMSkySphereShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectLayerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectLayerInterface.kt new file mode 100644 index 000000000..d9f548234 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectLayerInterface.kt @@ -0,0 +1,35 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from sphere_effect.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMSphereEffectLayerInterface", exact = true) +actual class KMSphereEffectLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCSphereEffectLayerInterface + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as MapCoreSharedModule.MCLayerInterfaceProtocol).asKmp() + } + + actual companion object + { + + actual fun create(): KMSphereEffectLayerInterface { + val result = MapCoreSharedModule.MCSphereEffectLayerInterface.create() + return (result as MapCoreSharedModule.MCSphereEffectLayerInterface).asKmp() + } + } +} + +internal fun KMSphereEffectLayerInterface.asPlatform(): MapCoreSharedModule.MCSphereEffectLayerInterface = nativeHandle as MapCoreSharedModule.MCSphereEffectLayerInterface +public fun MapCoreSharedModule.MCSphereEffectLayerInterface.asKmp(): KMSphereEffectLayerInterface = KMSphereEffectLayerInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectShaderInterface.kt new file mode 100644 index 000000000..c2cf2049a --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSphereEffectShaderInterface.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMSphereEffectShaderInterface", exact = true) +actual class KMSphereEffectShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCSphereEffectShaderInterfaceProtocol + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } + + actual fun setEllipse(coefficients: KMSharedBytes) { + native.setEllipse(coefficients.asPlatform()) + } +} + +internal fun KMSphereEffectShaderInterface.asPlatform(): MapCoreSharedModule.MCSphereEffectShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCSphereEffectShaderInterfaceProtocol +public fun MapCoreSharedModule.MCSphereEffectShaderInterfaceProtocol.asKmp(): KMSphereEffectShaderInterface = KMSphereEffectShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchInstancedShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchInstancedShaderInterface.kt new file mode 100644 index 000000000..95a076ceb --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchInstancedShaderInterface.kt @@ -0,0 +1,26 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMStretchInstancedShaderInterface", exact = true) +actual class KMStretchInstancedShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCStretchInstancedShaderInterfaceProtocol + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } +} + +internal fun KMStretchInstancedShaderInterface.asPlatform(): MapCoreSharedModule.MCStretchInstancedShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCStretchInstancedShaderInterfaceProtocol +public fun MapCoreSharedModule.MCStretchInstancedShaderInterfaceProtocol.asKmp(): KMStretchInstancedShaderInterface = KMStretchInstancedShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInfo.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInfo.kt new file mode 100644 index 000000000..dd0a43d10 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInfo.kt @@ -0,0 +1,64 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMStretchShaderInfo", exact = true) +actual class KMStretchShaderInfo actual public constructor( + scaleX: Float, + stretchX0Begin: Float, + stretchX0End: Float, + stretchX1Begin: Float, + stretchX1End: Float, + scaleY: Float, + stretchY0Begin: Float, + stretchY0End: Float, + stretchY1Begin: Float, + stretchY1End: Float, + uv: KMRectD, +) { + actual val scaleX: Float = scaleX + actual val stretchX0Begin: Float = stretchX0Begin + actual val stretchX0End: Float = stretchX0End + actual val stretchX1Begin: Float = stretchX1Begin + actual val stretchX1End: Float = stretchX1End + actual val scaleY: Float = scaleY + actual val stretchY0Begin: Float = stretchY0Begin + actual val stretchY0End: Float = stretchY0End + actual val stretchY1Begin: Float = stretchY1Begin + actual val stretchY1End: Float = stretchY1End + actual val uv: KMRectD = uv +} + +internal fun KMStretchShaderInfo.asPlatform(): MapCoreSharedModule.MCStretchShaderInfo = MapCoreSharedModule.MCStretchShaderInfo( + scaleX = scaleX, + stretchX0Begin = stretchX0Begin, + stretchX0End = stretchX0End, + stretchX1Begin = stretchX1Begin, + stretchX1End = stretchX1End, + scaleY = scaleY, + stretchY0Begin = stretchY0Begin, + stretchY0End = stretchY0End, + stretchY1Begin = stretchY1Begin, + stretchY1End = stretchY1End, + uv = uv.asPlatform(), +) +public fun MapCoreSharedModule.MCStretchShaderInfo.asKmp(): KMStretchShaderInfo = KMStretchShaderInfo( + scaleX = this.scaleX, + stretchX0Begin = this.stretchX0Begin, + stretchX0End = this.stretchX0End, + stretchX1Begin = this.stretchX1Begin, + stretchX1End = this.stretchX1End, + scaleY = this.scaleY, + stretchY0Begin = this.stretchY0Begin, + stretchY0End = this.stretchY0End, + stretchY1Begin = this.stretchY1Begin, + stretchY1End = this.stretchY1End, + uv = (this.uv as MapCoreSharedModule.MCRectD).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInterface.kt new file mode 100644 index 000000000..2524e0522 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMStretchShaderInterface.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMStretchShaderInterface", exact = true) +actual class KMStretchShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCStretchShaderInterfaceProtocol + + actual fun updateAlpha(value: Float) { + native.updateAlpha(value) + } + + actual fun updateStretchInfo(info: KMStretchShaderInfo) { + native.updateStretchInfo(info.asPlatform()) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } +} + +internal fun KMStretchShaderInterface.asPlatform(): MapCoreSharedModule.MCStretchShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCStretchShaderInterfaceProtocol +public fun MapCoreSharedModule.MCStretchShaderInterfaceProtocol.asKmp(): KMStretchShaderInterface = KMStretchShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolAlignment.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolAlignment.kt new file mode 100644 index 000000000..d364d3e2a --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolAlignment.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMSymbolAlignment", exact = true) +actual enum class KMSymbolAlignment(val rawValue: Long) { + MAP(0L), + VIEWPORT(1L), + AUTO(2L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCSymbolAlignment): KMSymbolAlignment { + val raw: Long = value + return when (raw) { + 0L -> KMSymbolAlignment.MAP + 1L -> KMSymbolAlignment.VIEWPORT + 2L -> KMSymbolAlignment.AUTO + else -> throw IllegalArgumentException("Unknown KMSymbolAlignment value: " + raw) + } + } + } +} + +internal fun KMSymbolAlignment.asPlatform(): MapCoreSharedModule.MCSymbolAlignment = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolZOrder.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolZOrder.kt new file mode 100644 index 000000000..13da66762 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMSymbolZOrder.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMSymbolZOrder", exact = true) +actual enum class KMSymbolZOrder(val rawValue: Long) { + AUTO(0L), + VIEWPORT_Y(1L), + SOURCE(2L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCSymbolZOrder): KMSymbolZOrder { + val raw: Long = value + return when (raw) { + 0L -> KMSymbolZOrder.AUTO + 1L -> KMSymbolZOrder.VIEWPORT_Y + 2L -> KMSymbolZOrder.SOURCE + else -> throw IllegalArgumentException("Unknown KMSymbolZOrder value: " + raw) + } + } + } +} + +internal fun KMSymbolZOrder.asPlatform(): MapCoreSharedModule.MCSymbolZOrder = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskConfig.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskConfig.kt new file mode 100644 index 000000000..e39f896c4 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskConfig.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTaskConfig", exact = true) +actual class KMTaskConfig actual public constructor( + id: String, + delay: Long, + priority: KMTaskPriority, + executionEnvironment: KMExecutionEnvironment, +) { + actual val id: String = id + actual val delay: Long = delay + actual val priority: KMTaskPriority = priority + actual val executionEnvironment: KMExecutionEnvironment = executionEnvironment +} + +internal fun KMTaskConfig.asPlatform(): MapCoreSharedModule.MCTaskConfig = MapCoreSharedModule.MCTaskConfig( + id = id, + delay = delay, + priority = priority.asPlatform(), + executionEnvironment = executionEnvironment.asPlatform(), +) +public fun MapCoreSharedModule.MCTaskConfig.asKmp(): KMTaskConfig = KMTaskConfig( + id = this.id, + delay = this.delay, + priority = KMTaskPriority.fromPlatform((this.priority as MapCoreSharedModule.MCTaskPriority)), + executionEnvironment = KMExecutionEnvironment.fromPlatform((this.executionEnvironment as MapCoreSharedModule.MCExecutionEnvironment)), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskInterface.kt new file mode 100644 index 000000000..3014ed324 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskInterface.kt @@ -0,0 +1,52 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTaskInterface", exact = true) +actual interface KMTaskInterface +{ + + actual fun getConfig(): KMTaskConfig + + actual fun run() +} + +private class KMTaskInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCTaskInterfaceProtocol) : KMTaskInterface +{ + + override fun getConfig(): KMTaskConfig { + val result = nativeHandle.getConfig() + return (result as MapCoreSharedModule.MCTaskConfig).asKmp() + } + + override fun run() { + nativeHandle.run() + } +} + +private class KMTaskInterfacePlatformProxy(private val delegate: KMTaskInterface) : NSObject(), MapCoreSharedModule.MCTaskInterfaceProtocol +{ + + override fun getConfig(): MapCoreSharedModule.MCTaskConfig { + val result = delegate.getConfig() + return result.asPlatform() + } + + override fun run() { + delegate.run() + } +} + +internal fun KMTaskInterface.asPlatform(): MapCoreSharedModule.MCTaskInterfaceProtocol = when (this) { + is KMTaskInterfacePlatformWrapper -> this.nativeHandle + else -> KMTaskInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCTaskInterfaceProtocol.asKmp(): KMTaskInterface = KMTaskInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskPriority.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskPriority.kt new file mode 100644 index 000000000..499ff755f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTaskPriority.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTaskPriority", exact = true) +actual enum class KMTaskPriority(val rawValue: Long) { + HIGH(0L), + NORMAL(1L), + LOW(2L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCTaskPriority): KMTaskPriority { + val raw: Long = value + return when (raw) { + 0L -> KMTaskPriority.HIGH + 1L -> KMTaskPriority.NORMAL + 2L -> KMTaskPriority.LOW + else -> throw IllegalArgumentException("Unknown KMTaskPriority value: " + raw) + } + } + } +} + +internal fun KMTaskPriority.asPlatform(): MapCoreSharedModule.MCTaskPriority = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTessellationMode.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTessellationMode.kt new file mode 100644 index 000000000..9171ab454 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTessellationMode.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTessellationMode", exact = true) +actual enum class KMTessellationMode(val rawValue: Long) { + NONE(0L), + QUAD(1L), + TRIANGLE(2L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCTessellationMode): KMTessellationMode { + val raw: Long = value + return when (raw) { + 0L -> KMTessellationMode.NONE + 1L -> KMTessellationMode.QUAD + 2L -> KMTessellationMode.TRIANGLE + else -> throw IllegalArgumentException("Unknown KMTessellationMode value: " + raw) + } + } + } +} + +internal fun KMTessellationMode.asPlatform(): MapCoreSharedModule.MCTessellationMode = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextDescription.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextDescription.kt new file mode 100644 index 000000000..ff63080cd --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextDescription.kt @@ -0,0 +1,24 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextDescription", exact = true) +actual class KMTextDescription actual public constructor( + glyphs: ArrayList, +) { + actual val glyphs: ArrayList = glyphs +} + +internal fun KMTextDescription.asPlatform(): MapCoreSharedModule.MCTextDescription = MapCoreSharedModule.MCTextDescription( + glyphs = ArrayList(glyphs.map { it.asPlatform() }), +) +public fun MapCoreSharedModule.MCTextDescription.asKmp(): KMTextDescription = KMTextDescription( + glyphs = ArrayList(((this.glyphs as? List<*>)?.map { (it as MapCoreSharedModule.MCGlyphDescription).asKmp() } ?: (0 until (this.glyphs as platform.Foundation.NSArray).count.toInt()).map { idx -> ((this.glyphs as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCGlyphDescription).asKmp() })), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextFactory.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextFactory.kt new file mode 100644 index 000000000..2a5655e1e --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextFactory.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextFactory", exact = true) +actual class KMTextFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCTextFactory + + actual companion object + { + + actual fun createText(text: ArrayList, coordinate: KMCoord, font: KMFont, textAnchor: KMAnchor, textJustify: KMTextJustify): KMTextInfoInterface { + val result = MapCoreSharedModule.MCTextFactory.createText(ArrayList(text.map { it.asPlatform() }), coordinate.asPlatform(), font.asPlatform(), textAnchor.asPlatform(), textJustify.asPlatform()) + return (result as MapCoreSharedModule.MCTextInfoInterfaceProtocol).asKmp() + } + } +} + +internal fun KMTextFactory.asPlatform(): MapCoreSharedModule.MCTextFactory = nativeHandle as MapCoreSharedModule.MCTextFactory +public fun MapCoreSharedModule.MCTextFactory.asKmp(): KMTextFactory = KMTextFactory(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInfoInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInfoInterface.kt new file mode 100644 index 000000000..2374dfe79 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInfoInterface.kt @@ -0,0 +1,114 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextInfoInterface", exact = true) +actual interface KMTextInfoInterface +{ + + actual fun getText(): ArrayList + + actual fun getCoordinate(): KMCoord + + actual fun getFont(): KMFont + + actual fun getTextAnchor(): KMAnchor + + actual fun getTextJustify(): KMTextJustify + + actual fun getSymbolPlacement(): KMTextSymbolPlacement + + actual fun getLineCoordinates(): ArrayList? +} + +private class KMTextInfoInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCTextInfoInterfaceProtocol) : KMTextInfoInterface +{ + + override fun getText(): ArrayList { + val result = nativeHandle.getText() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCFormattedStringEntry).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCFormattedStringEntry).asKmp() })) + } + + override fun getCoordinate(): KMCoord { + val result = nativeHandle.getCoordinate() + return (result as MapCoreSharedModule.MCCoord).asKmp() + } + + override fun getFont(): KMFont { + val result = nativeHandle.getFont() + return (result as MapCoreSharedModule.MCFont).asKmp() + } + + override fun getTextAnchor(): KMAnchor { + val result = nativeHandle.getTextAnchor() + return KMAnchor.fromPlatform((result as MapCoreSharedModule.MCAnchor)) + } + + override fun getTextJustify(): KMTextJustify { + val result = nativeHandle.getTextJustify() + return KMTextJustify.fromPlatform((result as MapCoreSharedModule.MCTextJustify)) + } + + override fun getSymbolPlacement(): KMTextSymbolPlacement { + val result = nativeHandle.getSymbolPlacement() + return KMTextSymbolPlacement.fromPlatform((result as MapCoreSharedModule.MCTextSymbolPlacement)) + } + + override fun getLineCoordinates(): ArrayList? { + val result = nativeHandle.getLineCoordinates() + return result?.let { ArrayList(((it as? List<*>)?.map { (it as MapCoreSharedModule.MCCoord).asKmp() } ?: (0 until (it as platform.Foundation.NSArray).count.toInt()).map { idx -> ((it as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCCoord).asKmp() })) } + } +} + +private class KMTextInfoInterfacePlatformProxy(private val delegate: KMTextInfoInterface) : NSObject(), MapCoreSharedModule.MCTextInfoInterfaceProtocol +{ + + override fun getText(): List<*> { + val result = delegate.getText() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun getCoordinate(): MapCoreSharedModule.MCCoord { + val result = delegate.getCoordinate() + return result.asPlatform() + } + + override fun getFont(): MapCoreSharedModule.MCFont { + val result = delegate.getFont() + return result.asPlatform() + } + + override fun getTextAnchor(): MapCoreSharedModule.MCAnchor { + val result = delegate.getTextAnchor() + return result.asPlatform() + } + + override fun getTextJustify(): MapCoreSharedModule.MCTextJustify { + val result = delegate.getTextJustify() + return result.asPlatform() + } + + override fun getSymbolPlacement(): MapCoreSharedModule.MCTextSymbolPlacement { + val result = delegate.getSymbolPlacement() + return result.asPlatform() + } + + override fun getLineCoordinates(): List<*>? { + val result = delegate.getLineCoordinates() + return result?.let { ArrayList(it.map { it.asPlatform() }) } + } +} + +internal fun KMTextInfoInterface.asPlatform(): MapCoreSharedModule.MCTextInfoInterfaceProtocol = when (this) { + is KMTextInfoInterfacePlatformWrapper -> this.nativeHandle + else -> KMTextInfoInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCTextInfoInterfaceProtocol.asKmp(): KMTextInfoInterface = KMTextInfoInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedInterface.kt new file mode 100644 index 000000000..6bbeee4a1 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedInterface.kt @@ -0,0 +1,162 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextInstancedInterface", exact = true) +actual interface KMTextInstancedInterface +{ + + actual fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) + + actual fun setInstanceCount(count: Int) + + actual fun setPositions(positions: KMSharedBytes) + + actual fun setReferencePositions(positions: KMSharedBytes) + + actual fun setTextureCoordinates(textureCoordinates: KMSharedBytes) + + actual fun setScales(scales: KMSharedBytes) + + actual fun setRotations(rotations: KMSharedBytes) + + actual fun setAlphas(alphas: KMSharedBytes) + + actual fun setStyleIndices(indices: KMSharedBytes) + + actual fun setStyles(values: KMSharedBytes) + + actual fun loadFont(context: KMRenderingContextInterface, fontData: KMFontData, fontMsdfTexture: KMTextureHolderInterface) + + actual fun removeTexture() + + actual fun asGraphicsObject(): KMGraphicsObjectInterface +} + +private class KMTextInstancedInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCTextInstancedInterfaceProtocol) : KMTextInstancedInterface +{ + + override fun setFrame(frame: KMQuad2dD, origin: KMVec3D, is3d: Boolean) { + nativeHandle.setFrame(frame.asPlatform(), origin.asPlatform(), is3d) + } + + override fun setInstanceCount(count: Int) { + nativeHandle.setInstanceCount(count) + } + + override fun setPositions(positions: KMSharedBytes) { + nativeHandle.setPositions(positions.asPlatform()) + } + + override fun setReferencePositions(positions: KMSharedBytes) { + nativeHandle.setReferencePositions(positions.asPlatform()) + } + + override fun setTextureCoordinates(textureCoordinates: KMSharedBytes) { + nativeHandle.setTextureCoordinates(textureCoordinates.asPlatform()) + } + + override fun setScales(scales: KMSharedBytes) { + nativeHandle.setScales(scales.asPlatform()) + } + + override fun setRotations(rotations: KMSharedBytes) { + nativeHandle.setRotations(rotations.asPlatform()) + } + + override fun setAlphas(alphas: KMSharedBytes) { + nativeHandle.setAlphas(alphas.asPlatform()) + } + + override fun setStyleIndices(indices: KMSharedBytes) { + nativeHandle.setStyleIndices(indices.asPlatform()) + } + + override fun setStyles(values: KMSharedBytes) { + nativeHandle.setStyles(values.asPlatform()) + } + + override fun loadFont(context: KMRenderingContextInterface, fontData: KMFontData, fontMsdfTexture: KMTextureHolderInterface) { + nativeHandle.loadFont(context.asPlatform(), fontData.asPlatform(), fontMsdfTexture.asPlatform()) + } + + override fun removeTexture() { + nativeHandle.removeTexture() + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol).asKmp() + } +} + +private class KMTextInstancedInterfacePlatformProxy(private val delegate: KMTextInstancedInterface) : NSObject(), MapCoreSharedModule.MCTextInstancedInterfaceProtocol +{ + + override fun setFrame(frame: MapCoreSharedModule.MCQuad2dD, origin: MapCoreSharedModule.MCVec3D, is3d: Boolean) { + delegate.setFrame((frame as MapCoreSharedModule.MCQuad2dD).asKmp(), (origin as MapCoreSharedModule.MCVec3D).asKmp(), is3d) + } + + override fun setInstanceCount(count: Int) { + delegate.setInstanceCount(count) + } + + override fun setPositions(positions: MapCoreSharedModule.MCSharedBytes) { + delegate.setPositions((positions as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setReferencePositions(positions: MapCoreSharedModule.MCSharedBytes) { + delegate.setReferencePositions((positions as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setTextureCoordinates(textureCoordinates: MapCoreSharedModule.MCSharedBytes) { + delegate.setTextureCoordinates((textureCoordinates as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setScales(scales: MapCoreSharedModule.MCSharedBytes) { + delegate.setScales((scales as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setRotations(rotations: MapCoreSharedModule.MCSharedBytes) { + delegate.setRotations((rotations as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setAlphas(alphas: MapCoreSharedModule.MCSharedBytes) { + delegate.setAlphas((alphas as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setStyleIndices(indices: MapCoreSharedModule.MCSharedBytes) { + delegate.setStyleIndices((indices as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun setStyles(values: MapCoreSharedModule.MCSharedBytes) { + delegate.setStyles((values as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun loadFont(context: MapCoreSharedModule.MCRenderingContextInterfaceProtocol?, fontData: MapCoreSharedModule.MCFontData, fontMsdfTexture: MapCoreSharedModule.MCTextureHolderInterfaceProtocol?) { + delegate.loadFont((context as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp(), (fontData as MapCoreSharedModule.MCFontData).asKmp(), (fontMsdfTexture as MapCoreSharedModule.MCTextureHolderInterfaceProtocol).asKmp()) + } + + override fun removeTexture() { + delegate.removeTexture() + } + + override fun asGraphicsObject(): MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol? { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } +} + +internal fun KMTextInstancedInterface.asPlatform(): MapCoreSharedModule.MCTextInstancedInterfaceProtocol = when (this) { + is KMTextInstancedInterfacePlatformWrapper -> this.nativeHandle + else -> KMTextInstancedInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCTextInstancedInterfaceProtocol.asKmp(): KMTextInstancedInterface = KMTextInstancedInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedShaderInterface.kt new file mode 100644 index 000000000..72201a647 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInstancedShaderInterface.kt @@ -0,0 +1,26 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextInstancedShaderInterface", exact = true) +actual class KMTextInstancedShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCTextInstancedShaderInterfaceProtocol + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } +} + +internal fun KMTextInstancedShaderInterface.asPlatform(): MapCoreSharedModule.MCTextInstancedShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCTextInstancedShaderInterfaceProtocol +public fun MapCoreSharedModule.MCTextInstancedShaderInterfaceProtocol.asKmp(): KMTextInstancedShaderInterface = KMTextInstancedShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInterface.kt new file mode 100644 index 000000000..175cfe315 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextInterface.kt @@ -0,0 +1,72 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextInterface", exact = true) +actual interface KMTextInterface +{ + + actual fun setTextsShared(vertices: KMSharedBytes, indices: KMSharedBytes) + + actual fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) + + actual fun removeTexture() + + actual fun asGraphicsObject(): KMGraphicsObjectInterface +} + +private class KMTextInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCTextInterfaceProtocol) : KMTextInterface +{ + + override fun setTextsShared(vertices: KMSharedBytes, indices: KMSharedBytes) { + nativeHandle.setTextsShared(vertices.asPlatform(), indices.asPlatform()) + } + + override fun loadTexture(context: KMRenderingContextInterface, textureHolder: KMTextureHolderInterface) { + nativeHandle.loadTexture(context.asPlatform(), textureHolder.asPlatform()) + } + + override fun removeTexture() { + nativeHandle.removeTexture() + } + + override fun asGraphicsObject(): KMGraphicsObjectInterface { + val result = nativeHandle.asGraphicsObject() + return (result as MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol).asKmp() + } +} + +private class KMTextInterfacePlatformProxy(private val delegate: KMTextInterface) : NSObject(), MapCoreSharedModule.MCTextInterfaceProtocol +{ + + override fun setTextsShared(vertices: MapCoreSharedModule.MCSharedBytes, indices: MapCoreSharedModule.MCSharedBytes) { + delegate.setTextsShared((vertices as MapCoreSharedModule.MCSharedBytes).asKmp(), (indices as MapCoreSharedModule.MCSharedBytes).asKmp()) + } + + override fun loadTexture(context: MapCoreSharedModule.MCRenderingContextInterfaceProtocol?, textureHolder: MapCoreSharedModule.MCTextureHolderInterfaceProtocol?) { + delegate.loadTexture((context as MapCoreSharedModule.MCRenderingContextInterfaceProtocol).asKmp(), (textureHolder as MapCoreSharedModule.MCTextureHolderInterfaceProtocol).asKmp()) + } + + override fun removeTexture() { + delegate.removeTexture() + } + + override fun asGraphicsObject(): MapCoreSharedModule.MCGraphicsObjectInterfaceProtocol? { + val result = delegate.asGraphicsObject() + return result.asPlatform() + } +} + +internal fun KMTextInterface.asPlatform(): MapCoreSharedModule.MCTextInterfaceProtocol = when (this) { + is KMTextInterfacePlatformWrapper -> this.nativeHandle + else -> KMTextInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCTextInterfaceProtocol.asKmp(): KMTextInterface = KMTextInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextJustify.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextJustify.kt new file mode 100644 index 000000000..7d0d6bfef --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextJustify.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextJustify", exact = true) +actual enum class KMTextJustify(val rawValue: Long) { + AUTO(0L), + LEFT(1L), + CENTER(2L), + RIGHT(3L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCTextJustify): KMTextJustify { + val raw: Long = value + return when (raw) { + 0L -> KMTextJustify.AUTO + 1L -> KMTextJustify.LEFT + 2L -> KMTextJustify.CENTER + 3L -> KMTextJustify.RIGHT + else -> throw IllegalArgumentException("Unknown KMTextJustify value: " + raw) + } + } + } +} + +internal fun KMTextJustify.asPlatform(): MapCoreSharedModule.MCTextJustify = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextLayerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextLayerInterface.kt new file mode 100644 index 000000000..0449d726f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextLayerInterface.kt @@ -0,0 +1,43 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextLayerInterface", exact = true) +actual class KMTextLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCTextLayerInterface + + actual fun setTexts(texts: ArrayList) { + native.setTexts(ArrayList(texts.map { it.asPlatform() })) + } + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as MapCoreSharedModule.MCLayerInterfaceProtocol).asKmp() + } + + actual fun invalidate() { + native.invalidate() + } + + actual companion object + { + + actual fun create(fontLoader: KMFontLoaderInterface): KMTextLayerInterface { + val result = MapCoreSharedModule.MCTextLayerInterface.create(fontLoader.asPlatform()) + return (result as MapCoreSharedModule.MCTextLayerInterface).asKmp() + } + } +} + +internal fun KMTextLayerInterface.asPlatform(): MapCoreSharedModule.MCTextLayerInterface = nativeHandle as MapCoreSharedModule.MCTextLayerInterface +public fun MapCoreSharedModule.MCTextLayerInterface.asKmp(): KMTextLayerInterface = KMTextLayerInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextShaderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextShaderInterface.kt new file mode 100644 index 000000000..38badc89f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextShaderInterface.kt @@ -0,0 +1,38 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from shader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextShaderInterface", exact = true) +actual class KMTextShaderInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCTextShaderInterfaceProtocol + + actual fun setColor(color: KMColor) { + native.setColor(color.asPlatform()) + } + + actual fun setOpacity(opacity: Float) { + native.setOpacity(opacity) + } + + actual fun setHaloColor(color: KMColor, width: Float, blur: Float) { + native.setHaloColor(color.asPlatform(), width, blur) + } + + actual fun asShaderProgramInterface(): KMShaderProgramInterface { + val result = native.asShaderProgramInterface() + return (result as MapCoreSharedModule.MCShaderProgramInterfaceProtocol).asKmp() + } +} + +internal fun KMTextShaderInterface.asPlatform(): MapCoreSharedModule.MCTextShaderInterfaceProtocol = nativeHandle as MapCoreSharedModule.MCTextShaderInterfaceProtocol +public fun MapCoreSharedModule.MCTextShaderInterfaceProtocol.asKmp(): KMTextShaderInterface = KMTextShaderInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextSymbolPlacement.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextSymbolPlacement.kt new file mode 100644 index 000000000..0f3fba43b --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextSymbolPlacement.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from text.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextSymbolPlacement", exact = true) +actual enum class KMTextSymbolPlacement(val rawValue: Long) { + POINT(0L), + LINE(1L), + LINE_CENTER(2L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCTextSymbolPlacement): KMTextSymbolPlacement { + val raw: Long = value + return when (raw) { + 0L -> KMTextSymbolPlacement.POINT + 1L -> KMTextSymbolPlacement.LINE + 2L -> KMTextSymbolPlacement.LINE_CENTER + else -> throw IllegalArgumentException("Unknown KMTextSymbolPlacement value: " + raw) + } + } + } +} + +internal fun KMTextSymbolPlacement.asPlatform(): MapCoreSharedModule.MCTextSymbolPlacement = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureAtlas.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureAtlas.kt new file mode 100644 index 000000000..274ed86b0 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureAtlas.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from packer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextureAtlas", exact = true) +actual class KMTextureAtlas actual public constructor( + uvMap: HashMap, + texture: KMTextureHolderInterface?, +) { + actual val uvMap: HashMap = uvMap + actual val texture: KMTextureHolderInterface? = texture +} + +internal fun KMTextureAtlas.asPlatform(): MapCoreSharedModule.MCTextureAtlas = MapCoreSharedModule.MCTextureAtlas( + uvMap = HashMap(uvMap.map { it.key to it.value.asPlatform() }.toMap()), + texture = texture?.let { it.asPlatform() }, +) +public fun MapCoreSharedModule.MCTextureAtlas.asKmp(): KMTextureAtlas = KMTextureAtlas( + uvMap = HashMap(((this.uvMap as? Map<*, *>)?.map { (it.key as String) to (it.value as MapCoreSharedModule.MCRectI).asKmp() }?.toMap() ?: run { val e = (this.uvMap as platform.Foundation.NSDictionary).keyEnumerator(); generateSequence { e.nextObject() }.associate { key -> (key as String) to ((this.uvMap as platform.Foundation.NSDictionary).objectForKey(key) as MapCoreSharedModule.MCRectI).asKmp() } })), + texture = this.texture?.let { (it as MapCoreSharedModule.MCTextureHolderInterfaceProtocol).asKmp() }, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureFilterType.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureFilterType.kt new file mode 100644 index 000000000..ecf24a2e2 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureFilterType.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextureFilterType", exact = true) +actual enum class KMTextureFilterType(val rawValue: Long) { + NEAREST(0L), + LINEAR(1L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCTextureFilterType): KMTextureFilterType { + val raw: Long = value + return when (raw) { + 0L -> KMTextureFilterType.NEAREST + 1L -> KMTextureFilterType.LINEAR + else -> throw IllegalArgumentException("Unknown KMTextureFilterType value: " + raw) + } + } + } +} + +internal fun KMTextureFilterType.asPlatform(): MapCoreSharedModule.MCTextureFilterType = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureHolderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureHolderInterface.kt new file mode 100644 index 000000000..cb4496c21 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureHolderInterface.kt @@ -0,0 +1,100 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from graphicsobjects.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextureHolderInterface", exact = true) +actual interface KMTextureHolderInterface +{ + + actual fun getImageWidth(): Int + + actual fun getImageHeight(): Int + + actual fun getTextureWidth(): Int + + actual fun getTextureHeight(): Int + + actual fun attachToGraphics(): Int + + actual fun clearFromGraphics() +} + +private class KMTextureHolderInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCTextureHolderInterfaceProtocol) : KMTextureHolderInterface +{ + + override fun getImageWidth(): Int { + val result = nativeHandle.getImageWidth() + return result + } + + override fun getImageHeight(): Int { + val result = nativeHandle.getImageHeight() + return result + } + + override fun getTextureWidth(): Int { + val result = nativeHandle.getTextureWidth() + return result + } + + override fun getTextureHeight(): Int { + val result = nativeHandle.getTextureHeight() + return result + } + + override fun attachToGraphics(): Int { + val result = nativeHandle.attachToGraphics() + return result + } + + override fun clearFromGraphics() { + nativeHandle.clearFromGraphics() + } +} + +private class KMTextureHolderInterfacePlatformProxy(private val delegate: KMTextureHolderInterface) : NSObject(), MapCoreSharedModule.MCTextureHolderInterfaceProtocol +{ + + override fun getImageWidth(): Int { + val result = delegate.getImageWidth() + return result + } + + override fun getImageHeight(): Int { + val result = delegate.getImageHeight() + return result + } + + override fun getTextureWidth(): Int { + val result = delegate.getTextureWidth() + return result + } + + override fun getTextureHeight(): Int { + val result = delegate.getTextureHeight() + return result + } + + override fun attachToGraphics(): Int { + val result = delegate.attachToGraphics() + return result + } + + override fun clearFromGraphics() { + delegate.clearFromGraphics() + } +} + +internal fun KMTextureHolderInterface.asPlatform(): MapCoreSharedModule.MCTextureHolderInterfaceProtocol = when (this) { + is KMTextureHolderInterfacePlatformWrapper -> this.nativeHandle + else -> KMTextureHolderInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCTextureHolderInterfaceProtocol.asKmp(): KMTextureHolderInterface = KMTextureHolderInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureLoaderResult.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureLoaderResult.kt new file mode 100644 index 000000000..80bcdd368 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTextureLoaderResult.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from loader.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTextureLoaderResult", exact = true) +actual class KMTextureLoaderResult actual public constructor( + data: KMTextureHolderInterface?, + etag: String?, + status: KMLoaderStatus, + errorCode: String?, +) { + actual val data: KMTextureHolderInterface? = data + actual val etag: String? = etag + actual val status: KMLoaderStatus = status + actual val errorCode: String? = errorCode +} + +internal fun KMTextureLoaderResult.asPlatform(): MapCoreSharedModule.MCTextureLoaderResult = MapCoreSharedModule.MCTextureLoaderResult( + data = data?.let { it.asPlatform() }, + etag = etag?.let { it }, + status = status.asPlatform(), + errorCode = errorCode?.let { it }, +) +public fun MapCoreSharedModule.MCTextureLoaderResult.asKmp(): KMTextureLoaderResult = KMTextureLoaderResult( + data = this.data?.let { (it as MapCoreSharedModule.MCTextureHolderInterfaceProtocol).asKmp() }, + etag = this.etag?.let { (it as String) }, + status = KMLoaderStatus.fromPlatform((this.status as MapCoreSharedModule.MCLoaderStatus)), + errorCode = this.errorCode?.let { (it as String) }, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMThreadPoolScheduler.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMThreadPoolScheduler.kt new file mode 100644 index 000000000..61f20c8c2 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMThreadPoolScheduler.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from task_scheduler.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMThreadPoolScheduler", exact = true) +actual class KMThreadPoolScheduler actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCThreadPoolScheduler + + actual companion object + { + + actual fun create(): KMSchedulerInterface { + val result = MapCoreSharedModule.MCThreadPoolScheduler.create() + return (result as MapCoreSharedModule.MCSchedulerInterfaceProtocol).asKmp() + } + } +} + +internal fun KMThreadPoolScheduler.asPlatform(): MapCoreSharedModule.MCThreadPoolScheduler = nativeHandle as MapCoreSharedModule.MCThreadPoolScheduler +public fun MapCoreSharedModule.MCThreadPoolScheduler.asKmp(): KMThreadPoolScheduler = KMThreadPoolScheduler(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapLayerConfig.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapLayerConfig.kt new file mode 100644 index 000000000..c888314a9 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapLayerConfig.kt @@ -0,0 +1,126 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapLayerConfig", exact = true) +actual interface KMTiled2dMapLayerConfig +{ + + actual fun getCoordinateSystemIdentifier(): Int + + actual fun getTileUrl(x: Int, y: Int, t: Int, zoom: Int): String + + actual fun getZoomLevelInfos(): ArrayList + + actual fun getVirtualZoomLevelInfos(): ArrayList + + actual fun getZoomInfo(): KMTiled2dMapZoomInfo + + actual fun getLayerName(): String + + actual fun getVectorSettings(): KMTiled2dMapVectorSettings? + + actual fun getBounds(): KMRectCoord? +} + +private class KMTiled2dMapLayerConfigPlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol) : KMTiled2dMapLayerConfig +{ + + override fun getCoordinateSystemIdentifier(): Int { + val result = nativeHandle.getCoordinateSystemIdentifier() + return result + } + + override fun getTileUrl(x: Int, y: Int, t: Int, zoom: Int): String { + val result = nativeHandle.getTileUrl(x, y, t, zoom) + return result + } + + override fun getZoomLevelInfos(): ArrayList { + val result = nativeHandle.getZoomLevelInfos() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCTiled2dMapZoomLevelInfo).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCTiled2dMapZoomLevelInfo).asKmp() })) + } + + override fun getVirtualZoomLevelInfos(): ArrayList { + val result = nativeHandle.getVirtualZoomLevelInfos() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCTiled2dMapZoomLevelInfo).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCTiled2dMapZoomLevelInfo).asKmp() })) + } + + override fun getZoomInfo(): KMTiled2dMapZoomInfo { + val result = nativeHandle.getZoomInfo() + return (result as MapCoreSharedModule.MCTiled2dMapZoomInfo).asKmp() + } + + override fun getLayerName(): String { + val result = nativeHandle.getLayerName() + return result + } + + override fun getVectorSettings(): KMTiled2dMapVectorSettings? { + val result = nativeHandle.getVectorSettings() + return result?.let { (it as MapCoreSharedModule.MCTiled2dMapVectorSettings).asKmp() } + } + + override fun getBounds(): KMRectCoord? { + val result = nativeHandle.getBounds() + return result?.let { (it as MapCoreSharedModule.MCRectCoord).asKmp() } + } +} + +private class KMTiled2dMapLayerConfigPlatformProxy(private val delegate: KMTiled2dMapLayerConfig) : NSObject(), MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol +{ + + override fun getCoordinateSystemIdentifier(): Int { + val result = delegate.getCoordinateSystemIdentifier() + return result + } + + override fun getTileUrl(x: Int, y: Int, t: Int, zoom: Int): String { + val result = delegate.getTileUrl(x, y, t, zoom) + return result + } + + override fun getZoomLevelInfos(): List<*> { + val result = delegate.getZoomLevelInfos() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun getVirtualZoomLevelInfos(): List<*> { + val result = delegate.getVirtualZoomLevelInfos() + return ArrayList(result.map { it.asPlatform() }) + } + + override fun getZoomInfo(): MapCoreSharedModule.MCTiled2dMapZoomInfo { + val result = delegate.getZoomInfo() + return result.asPlatform() + } + + override fun getLayerName(): String { + val result = delegate.getLayerName() + return result + } + + override fun getVectorSettings(): MapCoreSharedModule.MCTiled2dMapVectorSettings? { + val result = delegate.getVectorSettings() + return result?.let { it.asPlatform() } + } + + override fun getBounds(): MapCoreSharedModule.MCRectCoord? { + val result = delegate.getBounds() + return result?.let { it.asPlatform() } + } +} + +internal fun KMTiled2dMapLayerConfig.asPlatform(): MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol = when (this) { + is KMTiled2dMapLayerConfigPlatformWrapper -> this.nativeHandle + else -> KMTiled2dMapLayerConfigPlatformProxy(this) +} +public fun MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol.asKmp(): KMTiled2dMapLayerConfig = KMTiled2dMapLayerConfigPlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerCallbackInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerCallbackInterface.kt new file mode 100644 index 000000000..66ccda8e4 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerCallbackInterface.kt @@ -0,0 +1,54 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_raster_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapRasterLayerCallbackInterface", exact = true) +actual interface KMTiled2dMapRasterLayerCallbackInterface +{ + + actual fun onClickConfirmed(coord: KMCoord): Boolean + + actual fun onLongPress(coord: KMCoord): Boolean +} + +private class KMTiled2dMapRasterLayerCallbackInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCTiled2dMapRasterLayerCallbackInterfaceProtocol) : KMTiled2dMapRasterLayerCallbackInterface +{ + + override fun onClickConfirmed(coord: KMCoord): Boolean { + val result = nativeHandle.onClickConfirmed(coord.asPlatform()) + return result + } + + override fun onLongPress(coord: KMCoord): Boolean { + val result = nativeHandle.onLongPress(coord.asPlatform()) + return result + } +} + +private class KMTiled2dMapRasterLayerCallbackInterfacePlatformProxy(private val delegate: KMTiled2dMapRasterLayerCallbackInterface) : NSObject(), MapCoreSharedModule.MCTiled2dMapRasterLayerCallbackInterfaceProtocol +{ + + override fun onClickConfirmed(coord: MapCoreSharedModule.MCCoord): Boolean { + val result = delegate.onClickConfirmed((coord as MapCoreSharedModule.MCCoord).asKmp()) + return result + } + + override fun onLongPress(coord: MapCoreSharedModule.MCCoord): Boolean { + val result = delegate.onLongPress((coord as MapCoreSharedModule.MCCoord).asKmp()) + return result + } +} + +internal fun KMTiled2dMapRasterLayerCallbackInterface.asPlatform(): MapCoreSharedModule.MCTiled2dMapRasterLayerCallbackInterfaceProtocol = when (this) { + is KMTiled2dMapRasterLayerCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMTiled2dMapRasterLayerCallbackInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCTiled2dMapRasterLayerCallbackInterfaceProtocol.asKmp(): KMTiled2dMapRasterLayerCallbackInterface = KMTiled2dMapRasterLayerCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerInterface.kt new file mode 100644 index 000000000..fc34613ef --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapRasterLayerInterface.kt @@ -0,0 +1,119 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_raster_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapRasterLayerInterface", exact = true) +actual class KMTiled2dMapRasterLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCTiled2dMapRasterLayerInterface + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as MapCoreSharedModule.MCLayerInterfaceProtocol).asKmp() + } + + actual fun setCallbackHandler(handler: KMTiled2dMapRasterLayerCallbackInterface) { + native.setCallbackHandler(handler.asPlatform()) + } + + actual fun getCallbackHandler(): KMTiled2dMapRasterLayerCallbackInterface? { + val result = native.getCallbackHandler() + return result?.let { (it as MapCoreSharedModule.MCTiled2dMapRasterLayerCallbackInterfaceProtocol).asKmp() } + } + + actual fun removeCallbackHandler() { + native.removeCallbackHandler() + } + + actual fun setAlpha(alpha: Float) { + native.setAlpha(alpha) + } + + actual fun getAlpha(): Float { + val result = native.getAlpha() + return result + } + + actual fun setStyle(style: KMRasterShaderStyle) { + native.setStyle(style.asPlatform()) + } + + actual fun getStyle(): KMRasterShaderStyle { + val result = native.getStyle() + return (result as MapCoreSharedModule.MCRasterShaderStyle).asKmp() + } + + actual fun setMinMagFilter(filterType: KMTextureFilterType) { + native.setMinMagFilter(filterType.asPlatform()) + } + + actual fun setMinZoomLevelIdentifier(value: Int?) { + native.setMinZoomLevelIdentifier(value?.let { platform.Foundation.NSNumber(int = it) }) + } + + actual fun getMinZoomLevelIdentifier(): Int? { + val result = native.getMinZoomLevelIdentifier() + return result?.let { (it as platform.Foundation.NSNumber).intValue } + } + + actual fun setMaxZoomLevelIdentifier(value: Int?) { + native.setMaxZoomLevelIdentifier(value?.let { platform.Foundation.NSNumber(int = it) }) + } + + actual fun getMaxZoomLevelIdentifier(): Int? { + val result = native.getMaxZoomLevelIdentifier() + return result?.let { (it as platform.Foundation.NSNumber).intValue } + } + + actual fun setT(t: Int) { + native.setT(t) + } + + actual fun setReadyStateListener(listener: KMTiled2dMapReadyStateListener?) { + native.setReadyStateListener(listener?.let { it.asPlatform() }) + } + + actual fun getConfig(): KMTiled2dMapLayerConfig { + val result = native.getConfig() + return (result as MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol).asKmp() + } + + actual fun set3dSubdivisionFactor(factor: Int) { + native.set3dSubdivisionFactor(factor) + } + + actual fun setBlendMode(blendMode: KMBlendMode) { + native.setBlendMode(blendMode.asPlatform()) + } + + actual companion object + { + + actual fun createWithMask(layerConfig: KMTiled2dMapLayerConfig, loaders: ArrayList, mask: KMMaskingObjectInterface): KMTiled2dMapRasterLayerInterface { + val result = MapCoreSharedModule.MCTiled2dMapRasterLayerInterface.createWithMask(layerConfig.asPlatform(), ArrayList(loaders.map { it.asPlatform() }), mask.asPlatform()) + return (result as MapCoreSharedModule.MCTiled2dMapRasterLayerInterface).asKmp() + } + + actual fun createWithShader(layerConfig: KMTiled2dMapLayerConfig, loaders: ArrayList, shader: KMShaderProgramInterface): KMTiled2dMapRasterLayerInterface { + val result = MapCoreSharedModule.MCTiled2dMapRasterLayerInterface.createWithShader(layerConfig.asPlatform(), ArrayList(loaders.map { it.asPlatform() }), shader.asPlatform()) + return (result as MapCoreSharedModule.MCTiled2dMapRasterLayerInterface).asKmp() + } + + actual fun create(layerConfig: KMTiled2dMapLayerConfig, loaders: ArrayList): KMTiled2dMapRasterLayerInterface { + val result = MapCoreSharedModule.MCTiled2dMapRasterLayerInterface.create(layerConfig.asPlatform(), ArrayList(loaders.map { it.asPlatform() })) + return (result as MapCoreSharedModule.MCTiled2dMapRasterLayerInterface).asKmp() + } + } +} + +internal fun KMTiled2dMapRasterLayerInterface.asPlatform(): MapCoreSharedModule.MCTiled2dMapRasterLayerInterface = nativeHandle as MapCoreSharedModule.MCTiled2dMapRasterLayerInterface +public fun MapCoreSharedModule.MCTiled2dMapRasterLayerInterface.asKmp(): KMTiled2dMapRasterLayerInterface = KMTiled2dMapRasterLayerInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapReadyStateListener.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapReadyStateListener.kt new file mode 100644 index 000000000..db4bbc06c --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapReadyStateListener.kt @@ -0,0 +1,40 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapReadyStateListener", exact = true) +actual interface KMTiled2dMapReadyStateListener +{ + + actual fun stateUpdate(state: KMLayerReadyState) +} + +private class KMTiled2dMapReadyStateListenerPlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCTiled2dMapReadyStateListenerProtocol) : KMTiled2dMapReadyStateListener +{ + + override fun stateUpdate(state: KMLayerReadyState) { + nativeHandle.stateUpdate(state.asPlatform()) + } +} + +private class KMTiled2dMapReadyStateListenerPlatformProxy(private val delegate: KMTiled2dMapReadyStateListener) : NSObject(), MapCoreSharedModule.MCTiled2dMapReadyStateListenerProtocol +{ + + override fun stateUpdate(state: MapCoreSharedModule.MCLayerReadyState) { + delegate.stateUpdate(KMLayerReadyState.fromPlatform((state as MapCoreSharedModule.MCLayerReadyState))) + } +} + +internal fun KMTiled2dMapReadyStateListener.asPlatform(): MapCoreSharedModule.MCTiled2dMapReadyStateListenerProtocol = when (this) { + is KMTiled2dMapReadyStateListenerPlatformWrapper -> this.nativeHandle + else -> KMTiled2dMapReadyStateListenerPlatformProxy(this) +} +public fun MapCoreSharedModule.MCTiled2dMapReadyStateListenerProtocol.asKmp(): KMTiled2dMapReadyStateListener = KMTiled2dMapReadyStateListenerPlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapSourceInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapSourceInterface.kt new file mode 100644 index 000000000..8ef75181b --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapSourceInterface.kt @@ -0,0 +1,72 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapSourceInterface", exact = true) +actual class KMTiled2dMapSourceInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCTiled2dMapSourceInterface + + actual fun onVisibleBoundsChanged(visibleBounds: KMRectCoord, curT: Int, zoom: Double) { + native.onVisibleBoundsChanged(visibleBounds.asPlatform(), curT, zoom) + } + + actual fun onCameraChange(viewMatrix: ArrayList, projectionMatrix: ArrayList, origin: KMVec3D, verticalFov: Float, horizontalFov: Float, width: Float, height: Float, focusPointAltitude: Float, focusPointPosition: KMCoord, zoom: Float) { + native.onCameraChange(ArrayList(viewMatrix.map { platform.Foundation.NSNumber(float = it) }), ArrayList(projectionMatrix.map { platform.Foundation.NSNumber(float = it) }), origin.asPlatform(), verticalFov, horizontalFov, width, height, focusPointAltitude, focusPointPosition.asPlatform(), zoom) + } + + actual fun setMinZoomLevelIdentifier(value: Int?) { + native.setMinZoomLevelIdentifier(value?.let { platform.Foundation.NSNumber(int = it) }) + } + + actual fun getMinZoomLevelIdentifier(): Int? { + val result = native.getMinZoomLevelIdentifier() + return result?.let { (it as platform.Foundation.NSNumber).intValue } + } + + actual fun setMaxZoomLevelIdentifier(value: Int?) { + native.setMaxZoomLevelIdentifier(value?.let { platform.Foundation.NSNumber(int = it) }) + } + + actual fun getMaxZoomLevelIdentifier(): Int? { + val result = native.getMaxZoomLevelIdentifier() + return result?.let { (it as platform.Foundation.NSNumber).intValue } + } + + actual fun pause() { + native.pause() + } + + actual fun resume() { + native.resume() + } + + actual fun isReadyToRenderOffscreen(): KMLayerReadyState { + val result = native.isReadyToRenderOffscreen() + return KMLayerReadyState.fromPlatform((result as MapCoreSharedModule.MCLayerReadyState)) + } + + actual fun setErrorManager(errorManager: KMErrorManager) { + native.setErrorManager(errorManager.asPlatform()) + } + + actual fun forceReload() { + native.forceReload() + } + + actual fun notifyTilesUpdates() { + native.notifyTilesUpdates() + } +} + +internal fun KMTiled2dMapSourceInterface.asPlatform(): MapCoreSharedModule.MCTiled2dMapSourceInterface = nativeHandle as MapCoreSharedModule.MCTiled2dMapSourceInterface +public fun MapCoreSharedModule.MCTiled2dMapSourceInterface.asKmp(): KMTiled2dMapSourceInterface = KMTiled2dMapSourceInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorAssetInfo.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorAssetInfo.kt new file mode 100644 index 000000000..b8e980920 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorAssetInfo.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapVectorAssetInfo", exact = true) +actual class KMTiled2dMapVectorAssetInfo actual public constructor( + featureIdentifiersUv: HashMap, + texture: KMTextureHolderInterface?, +) { + actual val featureIdentifiersUv: HashMap = featureIdentifiersUv + actual val texture: KMTextureHolderInterface? = texture +} + +internal fun KMTiled2dMapVectorAssetInfo.asPlatform(): MapCoreSharedModule.MCTiled2dMapVectorAssetInfo = MapCoreSharedModule.MCTiled2dMapVectorAssetInfo( + featureIdentifiersUv = HashMap(featureIdentifiersUv.map { it.key to it.value.asPlatform() }.toMap()), + texture = texture?.let { it.asPlatform() }, +) +public fun MapCoreSharedModule.MCTiled2dMapVectorAssetInfo.asKmp(): KMTiled2dMapVectorAssetInfo = KMTiled2dMapVectorAssetInfo( + featureIdentifiersUv = HashMap(((this.featureIdentifiersUv as? Map<*, *>)?.map { (it.key as String) to (it.value as MapCoreSharedModule.MCRectI).asKmp() }?.toMap() ?: run { val e = (this.featureIdentifiersUv as platform.Foundation.NSDictionary).keyEnumerator(); generateSequence { e.nextObject() }.associate { key -> (key as String) to ((this.featureIdentifiersUv as platform.Foundation.NSDictionary).objectForKey(key) as MapCoreSharedModule.MCRectI).asKmp() } })), + texture = this.texture?.let { (it as MapCoreSharedModule.MCTextureHolderInterfaceProtocol).asKmp() }, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerInterface.kt new file mode 100644 index 000000000..28e33473a --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerInterface.kt @@ -0,0 +1,96 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapVectorLayerInterface", exact = true) +actual class KMTiled2dMapVectorLayerInterface actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCTiled2dMapVectorLayerInterface + + actual fun setSelectionDelegate(selectionDelegate: KMTiled2dMapVectorLayerSelectionCallbackInterface?) { + native.setSelectionDelegate(selectionDelegate?.let { it.asPlatform() }) + } + + actual fun asLayerInterface(): KMLayerInterface { + val result = native.asLayerInterface() + return (result as MapCoreSharedModule.MCLayerInterfaceProtocol).asKmp() + } + + actual fun setMinZoomLevelIdentifier(value: Int?) { + native.setMinZoomLevelIdentifier(value?.let { platform.Foundation.NSNumber(int = it) }) + } + + actual fun getMinZoomLevelIdentifier(): Int? { + val result = native.getMinZoomLevelIdentifier() + return result?.let { (it as platform.Foundation.NSNumber).intValue } + } + + actual fun setMaxZoomLevelIdentifier(value: Int?) { + native.setMaxZoomLevelIdentifier(value?.let { platform.Foundation.NSNumber(int = it) }) + } + + actual fun getMaxZoomLevelIdentifier(): Int? { + val result = native.getMaxZoomLevelIdentifier() + return result?.let { (it as platform.Foundation.NSNumber).intValue } + } + + actual fun getStyleMetadataJson(): String? { + val result = native.getStyleMetadataJson() + return result?.let { (it as String) } + } + + actual fun setFeatureState(identifier: String, properties: HashMap) { + native.setFeatureState(identifier, HashMap(properties.map { it.key to it.value.asPlatform() }.toMap())) + } + + actual fun setGlobalState(properties: HashMap) { + native.setGlobalState(HashMap(properties.map { it.key to it.value.asPlatform() }.toMap())) + } + + actual fun getVisiblePointFeatureContexts(paddingPc: Float, sourceLayer: String?): ArrayList { + val result = native.getVisiblePointFeatureContexts(paddingPc, sourceLayer?.let { it }) + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCVectorLayerFeatureCoordInfo).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCVectorLayerFeatureCoordInfo).asKmp() })) + } + + actual fun setReadyStateListener(listener: KMTiled2dMapReadyStateListener?) { + native.setReadyStateListener(listener?.let { it.asPlatform() }) + } + + actual fun reloadDataSource(sourceName: String) { + native.reloadDataSource(sourceName) + } + + actual fun reloadLocalDataSource(sourceName: String, geoJson: String) { + native.reloadLocalDataSource(sourceName, geoJson) + } + + actual fun performClick(coord: KMCoord) { + native.performClick(coord.asPlatform()) + } + + actual companion object + { + + actual fun createFromStyleJson(layerName: String, styleJsonUrl: String, loaders: ArrayList, fontLoader: KMFontLoaderInterface): KMTiled2dMapVectorLayerInterface { + val result = MapCoreSharedModule.MCTiled2dMapVectorLayerInterface.createFromStyleJson(layerName, styleJsonUrl, ArrayList(loaders.map { it.asPlatform() }), fontLoader.asPlatform()) + return (result as MapCoreSharedModule.MCTiled2dMapVectorLayerInterface).asKmp() + } + + actual fun createExplicitly(layerName: String, styleJson: String?, localStyleJson: Boolean?, loaders: ArrayList, fontLoader: KMFontLoaderInterface, localDataProvider: KMTiled2dMapVectorLayerLocalDataProviderInterface?, customZoomInfo: KMTiled2dMapZoomInfo?, symbolDelegate: KMTiled2dMapVectorLayerSymbolDelegateInterface?, sourceUrlParams: HashMap?): KMTiled2dMapVectorLayerInterface { + val result = MapCoreSharedModule.MCTiled2dMapVectorLayerInterface.createExplicitly(layerName, styleJson?.let { it }, localStyleJson?.let { platform.Foundation.NSNumber(bool = it) }, ArrayList(loaders.map { it.asPlatform() }), fontLoader.asPlatform(), localDataProvider?.let { it.asPlatform() }, customZoomInfo?.let { it.asPlatform() }, symbolDelegate?.let { it.asPlatform() }, sourceUrlParams?.let { HashMap(it.map { it.key to it.value }.toMap()) }) + return (result as MapCoreSharedModule.MCTiled2dMapVectorLayerInterface).asKmp() + } + } +} + +internal fun KMTiled2dMapVectorLayerInterface.asPlatform(): MapCoreSharedModule.MCTiled2dMapVectorLayerInterface = nativeHandle as MapCoreSharedModule.MCTiled2dMapVectorLayerInterface +public fun MapCoreSharedModule.MCTiled2dMapVectorLayerInterface.asKmp(): KMTiled2dMapVectorLayerInterface = KMTiled2dMapVectorLayerInterface(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerLocalDataProviderInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerLocalDataProviderInterface.kt new file mode 100644 index 000000000..31a8f034f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerLocalDataProviderInterface.kt @@ -0,0 +1,78 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapVectorLayerLocalDataProviderInterface", exact = true) +actual interface KMTiled2dMapVectorLayerLocalDataProviderInterface +{ + + actual fun getStyleJson(): String? + + actual fun loadSpriteAsync(spriteId: String, url: String, scale: Int): KMFuture + + actual fun loadSpriteJsonAsync(spriteId: String, url: String, scale: Int): KMFuture + + actual fun loadGeojson(sourceName: String, url: String): KMFuture +} + +private class KMTiled2dMapVectorLayerLocalDataProviderInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCTiled2dMapVectorLayerLocalDataProviderInterfaceProtocol) : KMTiled2dMapVectorLayerLocalDataProviderInterface +{ + + override fun getStyleJson(): String? { + val result = nativeHandle.getStyleJson() + return result?.let { (it as String) } + } + + override fun loadSpriteAsync(spriteId: String, url: String, scale: Int): KMFuture { + val result = nativeHandle.loadSpriteAsync(spriteId, url, scale) + return (result as MapCoreSharedModule.DJFuture).asKmp() + } + + override fun loadSpriteJsonAsync(spriteId: String, url: String, scale: Int): KMFuture { + val result = nativeHandle.loadSpriteJsonAsync(spriteId, url, scale) + return (result as MapCoreSharedModule.DJFuture).asKmp() + } + + override fun loadGeojson(sourceName: String, url: String): KMFuture { + val result = nativeHandle.loadGeojson(sourceName, url) + return (result as MapCoreSharedModule.DJFuture).asKmp() + } +} + +private class KMTiled2dMapVectorLayerLocalDataProviderInterfacePlatformProxy(private val delegate: KMTiled2dMapVectorLayerLocalDataProviderInterface) : NSObject(), MapCoreSharedModule.MCTiled2dMapVectorLayerLocalDataProviderInterfaceProtocol +{ + + override fun getStyleJson(): String? { + val result = delegate.getStyleJson() + return result?.let { it } + } + + override fun loadSpriteAsync(spriteId: String, url: String, scale: Int): MapCoreSharedModule.DJFuture { + val result = delegate.loadSpriteAsync(spriteId, url, scale) + return result.asPlatform() + } + + override fun loadSpriteJsonAsync(spriteId: String, url: String, scale: Int): MapCoreSharedModule.DJFuture { + val result = delegate.loadSpriteJsonAsync(spriteId, url, scale) + return result.asPlatform() + } + + override fun loadGeojson(sourceName: String, url: String): MapCoreSharedModule.DJFuture { + val result = delegate.loadGeojson(sourceName, url) + return result.asPlatform() + } +} + +internal fun KMTiled2dMapVectorLayerLocalDataProviderInterface.asPlatform(): MapCoreSharedModule.MCTiled2dMapVectorLayerLocalDataProviderInterfaceProtocol = when (this) { + is KMTiled2dMapVectorLayerLocalDataProviderInterfacePlatformWrapper -> this.nativeHandle + else -> KMTiled2dMapVectorLayerLocalDataProviderInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCTiled2dMapVectorLayerLocalDataProviderInterfaceProtocol.asKmp(): KMTiled2dMapVectorLayerLocalDataProviderInterface = KMTiled2dMapVectorLayerLocalDataProviderInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSelectionCallbackInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSelectionCallbackInterface.kt new file mode 100644 index 000000000..72d474a2a --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSelectionCallbackInterface.kt @@ -0,0 +1,66 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapVectorLayerSelectionCallbackInterface", exact = true) +actual interface KMTiled2dMapVectorLayerSelectionCallbackInterface +{ + + actual fun didSelectFeature(featureInfo: KMVectorLayerFeatureInfo, layerIdentifier: String, coord: KMCoord): Boolean + + actual fun didMultiSelectLayerFeatures(featureInfos: ArrayList, layerIdentifier: String, coord: KMCoord): Boolean + + actual fun didClickBackgroundConfirmed(coord: KMCoord): Boolean +} + +private class KMTiled2dMapVectorLayerSelectionCallbackInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCTiled2dMapVectorLayerSelectionCallbackInterfaceProtocol) : KMTiled2dMapVectorLayerSelectionCallbackInterface +{ + + override fun didSelectFeature(featureInfo: KMVectorLayerFeatureInfo, layerIdentifier: String, coord: KMCoord): Boolean { + val result = nativeHandle.didSelectFeature(featureInfo.asPlatform(), layerIdentifier, coord.asPlatform()) + return result + } + + override fun didMultiSelectLayerFeatures(featureInfos: ArrayList, layerIdentifier: String, coord: KMCoord): Boolean { + val result = nativeHandle.didMultiSelectLayerFeatures(ArrayList(featureInfos.map { it.asPlatform() }), layerIdentifier, coord.asPlatform()) + return result + } + + override fun didClickBackgroundConfirmed(coord: KMCoord): Boolean { + val result = nativeHandle.didClickBackgroundConfirmed(coord.asPlatform()) + return result + } +} + +private class KMTiled2dMapVectorLayerSelectionCallbackInterfacePlatformProxy(private val delegate: KMTiled2dMapVectorLayerSelectionCallbackInterface) : NSObject(), MapCoreSharedModule.MCTiled2dMapVectorLayerSelectionCallbackInterfaceProtocol +{ + + override fun didSelectFeature(featureInfo: MapCoreSharedModule.MCVectorLayerFeatureInfo, layerIdentifier: String, coord: MapCoreSharedModule.MCCoord): Boolean { + val result = delegate.didSelectFeature((featureInfo as MapCoreSharedModule.MCVectorLayerFeatureInfo).asKmp(), layerIdentifier, (coord as MapCoreSharedModule.MCCoord).asKmp()) + return result + } + + override fun didMultiSelectLayerFeatures(featureInfos: List<*>, layerIdentifier: String, coord: MapCoreSharedModule.MCCoord): Boolean { + val result = delegate.didMultiSelectLayerFeatures(ArrayList(((featureInfos as? List<*>)?.map { (it as MapCoreSharedModule.MCVectorLayerFeatureInfo).asKmp() } ?: (0 until (featureInfos as platform.Foundation.NSArray).count.toInt()).map { idx -> ((featureInfos as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCVectorLayerFeatureInfo).asKmp() })), layerIdentifier, (coord as MapCoreSharedModule.MCCoord).asKmp()) + return result + } + + override fun didClickBackgroundConfirmed(coord: MapCoreSharedModule.MCCoord): Boolean { + val result = delegate.didClickBackgroundConfirmed((coord as MapCoreSharedModule.MCCoord).asKmp()) + return result + } +} + +internal fun KMTiled2dMapVectorLayerSelectionCallbackInterface.asPlatform(): MapCoreSharedModule.MCTiled2dMapVectorLayerSelectionCallbackInterfaceProtocol = when (this) { + is KMTiled2dMapVectorLayerSelectionCallbackInterfacePlatformWrapper -> this.nativeHandle + else -> KMTiled2dMapVectorLayerSelectionCallbackInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCTiled2dMapVectorLayerSelectionCallbackInterfaceProtocol.asKmp(): KMTiled2dMapVectorLayerSelectionCallbackInterface = KMTiled2dMapVectorLayerSelectionCallbackInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSymbolDelegateInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSymbolDelegateInterface.kt new file mode 100644 index 000000000..bafe141f5 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorLayerSymbolDelegateInterface.kt @@ -0,0 +1,42 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapVectorLayerSymbolDelegateInterface", exact = true) +actual interface KMTiled2dMapVectorLayerSymbolDelegateInterface +{ + + actual fun getCustomAssetsFor(featureInfos: ArrayList, layerIdentifier: String): ArrayList +} + +private class KMTiled2dMapVectorLayerSymbolDelegateInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCTiled2dMapVectorLayerSymbolDelegateInterfaceProtocol) : KMTiled2dMapVectorLayerSymbolDelegateInterface +{ + + override fun getCustomAssetsFor(featureInfos: ArrayList, layerIdentifier: String): ArrayList { + val result = nativeHandle.getCustomAssetsFor(ArrayList(featureInfos.map { it.asPlatform() }), layerIdentifier) + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCTiled2dMapVectorAssetInfo).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCTiled2dMapVectorAssetInfo).asKmp() })) + } +} + +private class KMTiled2dMapVectorLayerSymbolDelegateInterfacePlatformProxy(private val delegate: KMTiled2dMapVectorLayerSymbolDelegateInterface) : NSObject(), MapCoreSharedModule.MCTiled2dMapVectorLayerSymbolDelegateInterfaceProtocol +{ + + override fun getCustomAssetsFor(featureInfos: List<*>, layerIdentifier: String): List<*> { + val result = delegate.getCustomAssetsFor(ArrayList(((featureInfos as? List<*>)?.map { (it as MapCoreSharedModule.MCVectorLayerFeatureInfo).asKmp() } ?: (0 until (featureInfos as platform.Foundation.NSArray).count.toInt()).map { idx -> ((featureInfos as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCVectorLayerFeatureInfo).asKmp() })), layerIdentifier) + return ArrayList(result.map { it.asPlatform() }) + } +} + +internal fun KMTiled2dMapVectorLayerSymbolDelegateInterface.asPlatform(): MapCoreSharedModule.MCTiled2dMapVectorLayerSymbolDelegateInterfaceProtocol = when (this) { + is KMTiled2dMapVectorLayerSymbolDelegateInterfacePlatformWrapper -> this.nativeHandle + else -> KMTiled2dMapVectorLayerSymbolDelegateInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCTiled2dMapVectorLayerSymbolDelegateInterfaceProtocol.asKmp(): KMTiled2dMapVectorLayerSymbolDelegateInterface = KMTiled2dMapVectorLayerSymbolDelegateInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorSettings.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorSettings.kt new file mode 100644 index 000000000..d5b2630c2 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorSettings.kt @@ -0,0 +1,24 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapVectorSettings", exact = true) +actual class KMTiled2dMapVectorSettings actual public constructor( + tileOrigin: KMTiled2dMapVectorTileOrigin, +) { + actual val tileOrigin: KMTiled2dMapVectorTileOrigin = tileOrigin +} + +internal fun KMTiled2dMapVectorSettings.asPlatform(): MapCoreSharedModule.MCTiled2dMapVectorSettings = MapCoreSharedModule.MCTiled2dMapVectorSettings( + tileOrigin = tileOrigin.asPlatform(), +) +public fun MapCoreSharedModule.MCTiled2dMapVectorSettings.asKmp(): KMTiled2dMapVectorSettings = KMTiled2dMapVectorSettings( + tileOrigin = KMTiled2dMapVectorTileOrigin.fromPlatform((this.tileOrigin as MapCoreSharedModule.MCTiled2dMapVectorTileOrigin)), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorTileOrigin.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorTileOrigin.kt new file mode 100644 index 000000000..f32789af0 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapVectorTileOrigin.kt @@ -0,0 +1,34 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapVectorTileOrigin", exact = true) +actual enum class KMTiled2dMapVectorTileOrigin(val rawValue: Long) { + TOP_LEFT(0L), + BOTTOM_LEFT(1L), + TOP_RIGHT(2L), + BOTTOM_RIGHT(3L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCTiled2dMapVectorTileOrigin): KMTiled2dMapVectorTileOrigin { + val raw: Long = value + return when (raw) { + 0L -> KMTiled2dMapVectorTileOrigin.TOP_LEFT + 1L -> KMTiled2dMapVectorTileOrigin.BOTTOM_LEFT + 2L -> KMTiled2dMapVectorTileOrigin.TOP_RIGHT + 3L -> KMTiled2dMapVectorTileOrigin.BOTTOM_RIGHT + else -> throw IllegalArgumentException("Unknown KMTiled2dMapVectorTileOrigin value: " + raw) + } + } + } +} + +internal fun KMTiled2dMapVectorTileOrigin.asPlatform(): MapCoreSharedModule.MCTiled2dMapVectorTileOrigin = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomInfo.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomInfo.kt new file mode 100644 index 000000000..ffdd13a08 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomInfo.kt @@ -0,0 +1,48 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapZoomInfo", exact = true) +actual class KMTiled2dMapZoomInfo actual public constructor( + zoomLevelScaleFactor: Float, + numDrawPreviousLayers: Int, + numDrawPreviousOrLaterTLayers: Int, + adaptScaleToScreen: Boolean, + maskTile: Boolean, + underzoom: Boolean, + overzoom: Boolean, +) { + actual val zoomLevelScaleFactor: Float = zoomLevelScaleFactor + actual val numDrawPreviousLayers: Int = numDrawPreviousLayers + actual val numDrawPreviousOrLaterTLayers: Int = numDrawPreviousOrLaterTLayers + actual val adaptScaleToScreen: Boolean = adaptScaleToScreen + actual val maskTile: Boolean = maskTile + actual val underzoom: Boolean = underzoom + actual val overzoom: Boolean = overzoom +} + +internal fun KMTiled2dMapZoomInfo.asPlatform(): MapCoreSharedModule.MCTiled2dMapZoomInfo = MapCoreSharedModule.MCTiled2dMapZoomInfo( + zoomLevelScaleFactor = zoomLevelScaleFactor, + numDrawPreviousLayers = numDrawPreviousLayers, + numDrawPreviousOrLaterTLayers = numDrawPreviousOrLaterTLayers, + adaptScaleToScreen = adaptScaleToScreen, + maskTile = maskTile, + underzoom = underzoom, + overzoom = overzoom, +) +public fun MapCoreSharedModule.MCTiled2dMapZoomInfo.asKmp(): KMTiled2dMapZoomInfo = KMTiled2dMapZoomInfo( + zoomLevelScaleFactor = this.zoomLevelScaleFactor, + numDrawPreviousLayers = this.numDrawPreviousLayers, + numDrawPreviousOrLaterTLayers = this.numDrawPreviousOrLaterTLayers, + adaptScaleToScreen = this.adaptScaleToScreen, + maskTile = this.maskTile, + underzoom = this.underzoom, + overzoom = this.overzoom, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomLevelInfo.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomLevelInfo.kt new file mode 100644 index 000000000..c8c675269 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiled2dMapZoomLevelInfo.kt @@ -0,0 +1,48 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiled2dMapZoomLevelInfo", exact = true) +actual class KMTiled2dMapZoomLevelInfo actual public constructor( + zoom: Double, + tileWidthLayerSystemUnits: Float, + numTilesX: Int, + numTilesY: Int, + numTilesT: Int, + zoomLevelIdentifier: Int, + bounds: KMRectCoord, +) { + actual val zoom: Double = zoom + actual val tileWidthLayerSystemUnits: Float = tileWidthLayerSystemUnits + actual val numTilesX: Int = numTilesX + actual val numTilesY: Int = numTilesY + actual val numTilesT: Int = numTilesT + actual val zoomLevelIdentifier: Int = zoomLevelIdentifier + actual val bounds: KMRectCoord = bounds +} + +internal fun KMTiled2dMapZoomLevelInfo.asPlatform(): MapCoreSharedModule.MCTiled2dMapZoomLevelInfo = MapCoreSharedModule.MCTiled2dMapZoomLevelInfo( + zoom = zoom, + tileWidthLayerSystemUnits = tileWidthLayerSystemUnits, + numTilesX = numTilesX, + numTilesY = numTilesY, + numTilesT = numTilesT, + zoomLevelIdentifier = zoomLevelIdentifier, + bounds = bounds.asPlatform(), +) +public fun MapCoreSharedModule.MCTiled2dMapZoomLevelInfo.asKmp(): KMTiled2dMapZoomLevelInfo = KMTiled2dMapZoomLevelInfo( + zoom = this.zoom, + tileWidthLayerSystemUnits = this.tileWidthLayerSystemUnits, + numTilesX = this.numTilesX, + numTilesY = this.numTilesY, + numTilesT = this.numTilesT, + zoomLevelIdentifier = this.zoomLevelIdentifier, + bounds = (this.bounds as MapCoreSharedModule.MCRectCoord).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiledLayerError.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiledLayerError.kt new file mode 100644 index 000000000..15ea9cde1 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTiledLayerError.kt @@ -0,0 +1,44 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from map_helpers.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTiledLayerError", exact = true) +actual class KMTiledLayerError actual public constructor( + status: KMLoaderStatus, + errorCode: String?, + layerName: String, + url: String, + isRecoverable: Boolean, + bounds: KMRectCoord?, +) { + actual val status: KMLoaderStatus = status + actual val errorCode: String? = errorCode + actual val layerName: String = layerName + actual val url: String = url + actual val isRecoverable: Boolean = isRecoverable + actual val bounds: KMRectCoord? = bounds +} + +internal fun KMTiledLayerError.asPlatform(): MapCoreSharedModule.MCTiledLayerError = MapCoreSharedModule.MCTiledLayerError( + status = status.asPlatform(), + errorCode = errorCode?.let { it }, + layerName = layerName, + url = url, + isRecoverable = isRecoverable, + bounds = bounds?.let { it.asPlatform() }, +) +public fun MapCoreSharedModule.MCTiledLayerError.asKmp(): KMTiledLayerError = KMTiledLayerError( + status = KMLoaderStatus.fromPlatform((this.status as MapCoreSharedModule.MCLoaderStatus)), + errorCode = this.errorCode?.let { (it as String) }, + layerName = this.layerName, + url = this.url, + isRecoverable = this.isRecoverable, + bounds = this.bounds?.let { (it as MapCoreSharedModule.MCRectCoord).asKmp() }, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchAction.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchAction.kt new file mode 100644 index 000000000..2f317db1f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchAction.kt @@ -0,0 +1,36 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTouchAction", exact = true) +actual enum class KMTouchAction(val rawValue: Long) { + DOWN(0L), + MOVE(1L), + UP(2L), + SCROLL(3L), + CANCEL(4L), + ; + + companion object { + internal fun fromPlatform(value: MapCoreSharedModule.MCTouchAction): KMTouchAction { + val raw: Long = value + return when (raw) { + 0L -> KMTouchAction.DOWN + 1L -> KMTouchAction.MOVE + 2L -> KMTouchAction.UP + 3L -> KMTouchAction.SCROLL + 4L -> KMTouchAction.CANCEL + else -> throw IllegalArgumentException("Unknown KMTouchAction value: " + raw) + } + } + } +} + +internal fun KMTouchAction.asPlatform(): MapCoreSharedModule.MCTouchAction = rawValue diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchEvent.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchEvent.kt new file mode 100644 index 000000000..6ceac69c6 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchEvent.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTouchEvent", exact = true) +actual class KMTouchEvent actual public constructor( + pointers: ArrayList, + scrollDelta: Float, + touchAction: KMTouchAction, +) { + actual val pointers: ArrayList = pointers + actual val scrollDelta: Float = scrollDelta + actual val touchAction: KMTouchAction = touchAction +} + +internal fun KMTouchEvent.asPlatform(): MapCoreSharedModule.MCTouchEvent = MapCoreSharedModule.MCTouchEvent( + pointers = ArrayList(pointers.map { it.asPlatform() }), + scrollDelta = scrollDelta, + touchAction = touchAction.asPlatform(), +) +public fun MapCoreSharedModule.MCTouchEvent.asKmp(): KMTouchEvent = KMTouchEvent( + pointers = ArrayList(((this.pointers as? List<*>)?.map { (it as MapCoreSharedModule.MCVec2F).asKmp() } ?: (0 until (this.pointers as platform.Foundation.NSArray).count.toInt()).map { idx -> ((this.pointers as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCVec2F).asKmp() })), + scrollDelta = this.scrollDelta, + touchAction = KMTouchAction.fromPlatform((this.touchAction as MapCoreSharedModule.MCTouchAction)), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchHandlerInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchHandlerInterface.kt new file mode 100644 index 000000000..11852de13 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchHandlerInterface.kt @@ -0,0 +1,70 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTouchHandlerInterface", exact = true) +actual interface KMTouchHandlerInterface +{ + + actual fun onTouchEvent(touchEvent: KMTouchEvent) + + actual fun insertListener(listener: KMTouchInterface, index: Int) + + actual fun addListener(listener: KMTouchInterface) + + actual fun removeListener(listener: KMTouchInterface) +} + +private class KMTouchHandlerInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCTouchHandlerInterfaceProtocol) : KMTouchHandlerInterface +{ + + override fun onTouchEvent(touchEvent: KMTouchEvent) { + nativeHandle.onTouchEvent(touchEvent.asPlatform()) + } + + override fun insertListener(listener: KMTouchInterface, index: Int) { + nativeHandle.insertListener(listener.asPlatform(), index) + } + + override fun addListener(listener: KMTouchInterface) { + nativeHandle.addListener(listener.asPlatform()) + } + + override fun removeListener(listener: KMTouchInterface) { + nativeHandle.removeListener(listener.asPlatform()) + } +} + +private class KMTouchHandlerInterfacePlatformProxy(private val delegate: KMTouchHandlerInterface) : NSObject(), MapCoreSharedModule.MCTouchHandlerInterfaceProtocol +{ + + override fun onTouchEvent(touchEvent: MapCoreSharedModule.MCTouchEvent) { + delegate.onTouchEvent((touchEvent as MapCoreSharedModule.MCTouchEvent).asKmp()) + } + + override fun insertListener(listener: MapCoreSharedModule.MCTouchInterfaceProtocol?, index: Int) { + delegate.insertListener((listener as MapCoreSharedModule.MCTouchInterfaceProtocol).asKmp(), index) + } + + override fun addListener(listener: MapCoreSharedModule.MCTouchInterfaceProtocol?) { + delegate.addListener((listener as MapCoreSharedModule.MCTouchInterfaceProtocol).asKmp()) + } + + override fun removeListener(listener: MapCoreSharedModule.MCTouchInterfaceProtocol?) { + delegate.removeListener((listener as MapCoreSharedModule.MCTouchInterfaceProtocol).asKmp()) + } +} + +internal fun KMTouchHandlerInterface.asPlatform(): MapCoreSharedModule.MCTouchHandlerInterfaceProtocol = when (this) { + is KMTouchHandlerInterfacePlatformWrapper -> this.nativeHandle + else -> KMTouchHandlerInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCTouchHandlerInterfaceProtocol.asKmp(): KMTouchHandlerInterface = KMTouchHandlerInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchInterface.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchInterface.kt new file mode 100644 index 000000000..4e88ba464 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMTouchInterface.kt @@ -0,0 +1,184 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from touch_handler.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName +import platform.darwin.NSObject + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMTouchInterface", exact = true) +actual interface KMTouchInterface +{ + + actual fun onTouchDown(posScreen: KMVec2F): Boolean + + actual fun onClickUnconfirmed(posScreen: KMVec2F): Boolean + + actual fun onClickConfirmed(posScreen: KMVec2F): Boolean + + actual fun onDoubleClick(posScreen: KMVec2F): Boolean + + actual fun onLongPress(posScreen: KMVec2F): Boolean + + actual fun onMove(deltaScreen: KMVec2F, confirmed: Boolean, doubleClick: Boolean): Boolean + + actual fun onMoveComplete(): Boolean + + actual fun onOneFingerDoubleClickMoveComplete(): Boolean + + actual fun onTwoFingerClick(posScreen1: KMVec2F, posScreen2: KMVec2F): Boolean + + actual fun onTwoFingerMove(posScreenOld: ArrayList, posScreenNew: ArrayList): Boolean + + actual fun onTwoFingerMoveComplete(): Boolean + + actual fun onScroll(posScreen: KMVec2F, scrollDelta: Float): Boolean + + actual fun clearTouch() +} + +private class KMTouchInterfacePlatformWrapper(internal val nativeHandle: MapCoreSharedModule.MCTouchInterfaceProtocol) : KMTouchInterface +{ + + override fun onTouchDown(posScreen: KMVec2F): Boolean { + val result = nativeHandle.onTouchDown(posScreen.asPlatform()) + return result + } + + override fun onClickUnconfirmed(posScreen: KMVec2F): Boolean { + val result = nativeHandle.onClickUnconfirmed(posScreen.asPlatform()) + return result + } + + override fun onClickConfirmed(posScreen: KMVec2F): Boolean { + val result = nativeHandle.onClickConfirmed(posScreen.asPlatform()) + return result + } + + override fun onDoubleClick(posScreen: KMVec2F): Boolean { + val result = nativeHandle.onDoubleClick(posScreen.asPlatform()) + return result + } + + override fun onLongPress(posScreen: KMVec2F): Boolean { + val result = nativeHandle.onLongPress(posScreen.asPlatform()) + return result + } + + override fun onMove(deltaScreen: KMVec2F, confirmed: Boolean, doubleClick: Boolean): Boolean { + val result = nativeHandle.onMove(deltaScreen.asPlatform(), confirmed, doubleClick) + return result + } + + override fun onMoveComplete(): Boolean { + val result = nativeHandle.onMoveComplete() + return result + } + + override fun onOneFingerDoubleClickMoveComplete(): Boolean { + val result = nativeHandle.onOneFingerDoubleClickMoveComplete() + return result + } + + override fun onTwoFingerClick(posScreen1: KMVec2F, posScreen2: KMVec2F): Boolean { + val result = nativeHandle.onTwoFingerClick(posScreen1.asPlatform(), posScreen2.asPlatform()) + return result + } + + override fun onTwoFingerMove(posScreenOld: ArrayList, posScreenNew: ArrayList): Boolean { + val result = nativeHandle.onTwoFingerMove(ArrayList(posScreenOld.map { it.asPlatform() }), ArrayList(posScreenNew.map { it.asPlatform() })) + return result + } + + override fun onTwoFingerMoveComplete(): Boolean { + val result = nativeHandle.onTwoFingerMoveComplete() + return result + } + + override fun onScroll(posScreen: KMVec2F, scrollDelta: Float): Boolean { + val result = nativeHandle.onScroll(posScreen.asPlatform(), scrollDelta) + return result + } + + override fun clearTouch() { + nativeHandle.clearTouch() + } +} + +private class KMTouchInterfacePlatformProxy(private val delegate: KMTouchInterface) : NSObject(), MapCoreSharedModule.MCTouchInterfaceProtocol +{ + + override fun onTouchDown(posScreen: MapCoreSharedModule.MCVec2F): Boolean { + val result = delegate.onTouchDown((posScreen as MapCoreSharedModule.MCVec2F).asKmp()) + return result + } + + override fun onClickUnconfirmed(posScreen: MapCoreSharedModule.MCVec2F): Boolean { + val result = delegate.onClickUnconfirmed((posScreen as MapCoreSharedModule.MCVec2F).asKmp()) + return result + } + + override fun onClickConfirmed(posScreen: MapCoreSharedModule.MCVec2F): Boolean { + val result = delegate.onClickConfirmed((posScreen as MapCoreSharedModule.MCVec2F).asKmp()) + return result + } + + override fun onDoubleClick(posScreen: MapCoreSharedModule.MCVec2F): Boolean { + val result = delegate.onDoubleClick((posScreen as MapCoreSharedModule.MCVec2F).asKmp()) + return result + } + + override fun onLongPress(posScreen: MapCoreSharedModule.MCVec2F): Boolean { + val result = delegate.onLongPress((posScreen as MapCoreSharedModule.MCVec2F).asKmp()) + return result + } + + override fun onMove(deltaScreen: MapCoreSharedModule.MCVec2F, confirmed: Boolean, doubleClick: Boolean): Boolean { + val result = delegate.onMove((deltaScreen as MapCoreSharedModule.MCVec2F).asKmp(), confirmed, doubleClick) + return result + } + + override fun onMoveComplete(): Boolean { + val result = delegate.onMoveComplete() + return result + } + + override fun onOneFingerDoubleClickMoveComplete(): Boolean { + val result = delegate.onOneFingerDoubleClickMoveComplete() + return result + } + + override fun onTwoFingerClick(posScreen1: MapCoreSharedModule.MCVec2F, posScreen2: MapCoreSharedModule.MCVec2F): Boolean { + val result = delegate.onTwoFingerClick((posScreen1 as MapCoreSharedModule.MCVec2F).asKmp(), (posScreen2 as MapCoreSharedModule.MCVec2F).asKmp()) + return result + } + + override fun onTwoFingerMove(posScreenOld: List<*>, posScreenNew: List<*>): Boolean { + val result = delegate.onTwoFingerMove(ArrayList(((posScreenOld as? List<*>)?.map { (it as MapCoreSharedModule.MCVec2F).asKmp() } ?: (0 until (posScreenOld as platform.Foundation.NSArray).count.toInt()).map { idx -> ((posScreenOld as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCVec2F).asKmp() })), ArrayList(((posScreenNew as? List<*>)?.map { (it as MapCoreSharedModule.MCVec2F).asKmp() } ?: (0 until (posScreenNew as platform.Foundation.NSArray).count.toInt()).map { idx -> ((posScreenNew as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCVec2F).asKmp() }))) + return result + } + + override fun onTwoFingerMoveComplete(): Boolean { + val result = delegate.onTwoFingerMoveComplete() + return result + } + + override fun onScroll(posScreen: MapCoreSharedModule.MCVec2F, scrollDelta: Float): Boolean { + val result = delegate.onScroll((posScreen as MapCoreSharedModule.MCVec2F).asKmp(), scrollDelta) + return result + } + + override fun clearTouch() { + delegate.clearTouch() + } +} + +internal fun KMTouchInterface.asPlatform(): MapCoreSharedModule.MCTouchInterfaceProtocol = when (this) { + is KMTouchInterfacePlatformWrapper -> this.nativeHandle + else -> KMTouchInterfacePlatformProxy(this) +} +public fun MapCoreSharedModule.MCTouchInterfaceProtocol.asKmp(): KMTouchInterface = KMTouchInterfacePlatformWrapper(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2D.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2D.kt new file mode 100644 index 000000000..df617d417 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2D.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMVec2D", exact = true) +actual class KMVec2D actual public constructor( + x: Double, + y: Double, +) { + actual val x: Double = x + actual val y: Double = y +} + +internal fun KMVec2D.asPlatform(): MapCoreSharedModule.MCVec2D = MapCoreSharedModule.MCVec2D( + x = x, + y = y, +) +public fun MapCoreSharedModule.MCVec2D.asKmp(): KMVec2D = KMVec2D( + x = this.x, + y = this.y, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2F.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2F.kt new file mode 100644 index 000000000..1a6faea8b --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2F.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMVec2F", exact = true) +actual class KMVec2F actual public constructor( + x: Float, + y: Float, +) { + actual val x: Float = x + actual val y: Float = y +} + +internal fun KMVec2F.asPlatform(): MapCoreSharedModule.MCVec2F = MapCoreSharedModule.MCVec2F( + x = x, + y = y, +) +public fun MapCoreSharedModule.MCVec2F.asKmp(): KMVec2F = KMVec2F( + x = this.x, + y = this.y, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2I.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2I.kt new file mode 100644 index 000000000..8570a6cc8 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec2I.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMVec2I", exact = true) +actual class KMVec2I actual public constructor( + x: Int, + y: Int, +) { + actual val x: Int = x + actual val y: Int = y +} + +internal fun KMVec2I.asPlatform(): MapCoreSharedModule.MCVec2I = MapCoreSharedModule.MCVec2I( + x = x, + y = y, +) +public fun MapCoreSharedModule.MCVec2I.asKmp(): KMVec2I = KMVec2I( + x = this.x, + y = this.y, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3D.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3D.kt new file mode 100644 index 000000000..8410b5366 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3D.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMVec3D", exact = true) +actual class KMVec3D actual public constructor( + x: Double, + y: Double, + z: Double, +) { + actual val x: Double = x + actual val y: Double = y + actual val z: Double = z +} + +internal fun KMVec3D.asPlatform(): MapCoreSharedModule.MCVec3D = MapCoreSharedModule.MCVec3D( + x = x, + y = y, + z = z, +) +public fun MapCoreSharedModule.MCVec3D.asKmp(): KMVec3D = KMVec3D( + x = this.x, + y = this.y, + z = this.z, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3F.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3F.kt new file mode 100644 index 000000000..0ef481f99 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3F.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMVec3F", exact = true) +actual class KMVec3F actual public constructor( + x: Float, + y: Float, + z: Float, +) { + actual val x: Float = x + actual val y: Float = y + actual val z: Float = z +} + +internal fun KMVec3F.asPlatform(): MapCoreSharedModule.MCVec3F = MapCoreSharedModule.MCVec3F( + x = x, + y = y, + z = z, +) +public fun MapCoreSharedModule.MCVec3F.asKmp(): KMVec3F = KMVec3F( + x = this.x, + y = this.y, + z = this.z, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3I.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3I.kt new file mode 100644 index 000000000..23b6f140f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVec3I.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from common.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMVec3I", exact = true) +actual class KMVec3I actual public constructor( + x: Int, + y: Int, + z: Int, +) { + actual val x: Int = x + actual val y: Int = y + actual val z: Int = z +} + +internal fun KMVec3I.asPlatform(): MapCoreSharedModule.MCVec3I = MapCoreSharedModule.MCVec3I( + x = x, + y = y, + z = z, +) +public fun MapCoreSharedModule.MCVec3I.asKmp(): KMVec3I = KMVec3I( + x = this.x, + y = this.y, + z = this.z, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureCoordInfo.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureCoordInfo.kt new file mode 100644 index 000000000..1d8cf73e8 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureCoordInfo.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMVectorLayerFeatureCoordInfo", exact = true) +actual class KMVectorLayerFeatureCoordInfo actual public constructor( + featureInfo: KMVectorLayerFeatureInfo, + coordinates: KMCoord, +) { + actual val featureInfo: KMVectorLayerFeatureInfo = featureInfo + actual val coordinates: KMCoord = coordinates +} + +internal fun KMVectorLayerFeatureCoordInfo.asPlatform(): MapCoreSharedModule.MCVectorLayerFeatureCoordInfo = MapCoreSharedModule.MCVectorLayerFeatureCoordInfo( + featureInfo = featureInfo.asPlatform(), + coordinates = coordinates.asPlatform(), +) +public fun MapCoreSharedModule.MCVectorLayerFeatureCoordInfo.asKmp(): KMVectorLayerFeatureCoordInfo = KMVectorLayerFeatureCoordInfo( + featureInfo = (this.featureInfo as MapCoreSharedModule.MCVectorLayerFeatureInfo).asKmp(), + coordinates = (this.coordinates as MapCoreSharedModule.MCCoord).asKmp(), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfo.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfo.kt new file mode 100644 index 000000000..00b77ebeb --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfo.kt @@ -0,0 +1,28 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMVectorLayerFeatureInfo", exact = true) +actual class KMVectorLayerFeatureInfo actual public constructor( + identifier: String, + properties: HashMap, +) { + actual val identifier: String = identifier + actual val properties: HashMap = properties +} + +internal fun KMVectorLayerFeatureInfo.asPlatform(): MapCoreSharedModule.MCVectorLayerFeatureInfo = MapCoreSharedModule.MCVectorLayerFeatureInfo( + identifier = identifier, + properties = HashMap(properties.map { it.key to it.value.asPlatform() }.toMap()), +) +public fun MapCoreSharedModule.MCVectorLayerFeatureInfo.asKmp(): KMVectorLayerFeatureInfo = KMVectorLayerFeatureInfo( + identifier = this.identifier, + properties = HashMap(((this.properties as? Map<*, *>)?.map { (it.key as String) to (it.value as MapCoreSharedModule.MCVectorLayerFeatureInfoValue).asKmp() }?.toMap() ?: run { val e = (this.properties as platform.Foundation.NSDictionary).keyEnumerator(); generateSequence { e.nextObject() }.associate { key -> (key as String) to ((this.properties as platform.Foundation.NSDictionary).objectForKey(key) as MapCoreSharedModule.MCVectorLayerFeatureInfoValue).asKmp() } })), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfoValue.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfoValue.kt new file mode 100644 index 000000000..27b121103 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMVectorLayerFeatureInfoValue.kt @@ -0,0 +1,48 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from tiled_vector_layer.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMVectorLayerFeatureInfoValue", exact = true) +actual class KMVectorLayerFeatureInfoValue actual public constructor( + stringVal: String?, + doubleVal: Double?, + intVal: Long?, + boolVal: Boolean?, + colorVal: KMColor?, + listFloatVal: ArrayList?, + listStringVal: ArrayList?, +) { + actual val stringVal: String? = stringVal + actual val doubleVal: Double? = doubleVal + actual val intVal: Long? = intVal + actual val boolVal: Boolean? = boolVal + actual val colorVal: KMColor? = colorVal + actual val listFloatVal: ArrayList? = listFloatVal + actual val listStringVal: ArrayList? = listStringVal +} + +internal fun KMVectorLayerFeatureInfoValue.asPlatform(): MapCoreSharedModule.MCVectorLayerFeatureInfoValue = MapCoreSharedModule.MCVectorLayerFeatureInfoValue( + stringVal = stringVal?.let { it }, + doubleVal = doubleVal?.let { platform.Foundation.NSNumber(double = it) }, + intVal = intVal?.let { platform.Foundation.NSNumber(longLong = it) }, + boolVal = boolVal?.let { platform.Foundation.NSNumber(bool = it) }, + colorVal = colorVal?.let { it.asPlatform() }, + listFloatVal = listFloatVal?.let { ArrayList(it.map { platform.Foundation.NSNumber(float = it) }) }, + listStringVal = listStringVal?.let { ArrayList(it.map { it }) }, +) +public fun MapCoreSharedModule.MCVectorLayerFeatureInfoValue.asKmp(): KMVectorLayerFeatureInfoValue = KMVectorLayerFeatureInfoValue( + stringVal = this.stringVal?.let { (it as String) }, + doubleVal = this.doubleVal?.let { (it as platform.Foundation.NSNumber).doubleValue }, + intVal = this.intVal?.let { (it as platform.Foundation.NSNumber).longLongValue }, + boolVal = this.boolVal?.let { (it as platform.Foundation.NSNumber).boolValue }, + colorVal = this.colorVal?.let { (it as MapCoreSharedModule.MCColor).asKmp() }, + listFloatVal = this.listFloatVal?.let { ArrayList(((it as? List<*>)?.map { (it as platform.Foundation.NSNumber).floatValue } ?: (0 until (it as platform.Foundation.NSArray).count.toInt()).map { idx -> ((it as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as platform.Foundation.NSNumber).floatValue })) }, + listStringVal = this.listStringVal?.let { ArrayList(((it as? List<*>)?.map { (it as String) } ?: (0 until (it as platform.Foundation.NSArray).count.toInt()).map { idx -> ((it as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as String) })) }, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsCapabilitiesResource.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsCapabilitiesResource.kt new file mode 100644 index 000000000..4cd42334f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsCapabilitiesResource.kt @@ -0,0 +1,75 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMWmtsCapabilitiesResource", exact = true) +actual class KMWmtsCapabilitiesResource actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCWmtsCapabilitiesResource + + actual fun createLayer(identifier: String, tileLoaders: ArrayList): KMTiled2dMapRasterLayerInterface? { + val result = native.createLayer(identifier, ArrayList(tileLoaders.map { it.asPlatform() })) + return result?.let { (it as MapCoreSharedModule.MCTiled2dMapRasterLayerInterface).asKmp() } + } + + actual fun createLayerTimed(identifier: String, tileLoaders: ArrayList, numT: Int): KMTiled2dMapRasterLayerInterface? { + val result = native.createLayerTimed(identifier, ArrayList(tileLoaders.map { it.asPlatform() }), numT) + return result?.let { (it as MapCoreSharedModule.MCTiled2dMapRasterLayerInterface).asKmp() } + } + + actual fun createLayerWithZoomInfo(identifier: String, tileLoaders: ArrayList, zoomInfo: KMTiled2dMapZoomInfo): KMTiled2dMapRasterLayerInterface? { + val result = native.createLayerWithZoomInfo(identifier, ArrayList(tileLoaders.map { it.asPlatform() }), zoomInfo.asPlatform()) + return result?.let { (it as MapCoreSharedModule.MCTiled2dMapRasterLayerInterface).asKmp() } + } + + actual fun createLayerWithZoomInfoTimed(identifier: String, tileLoaders: ArrayList, zoomInfo: KMTiled2dMapZoomInfo, numT: Int): KMTiled2dMapRasterLayerInterface? { + val result = native.createLayerWithZoomInfoTimed(identifier, ArrayList(tileLoaders.map { it.asPlatform() }), zoomInfo.asPlatform(), numT) + return result?.let { (it as MapCoreSharedModule.MCTiled2dMapRasterLayerInterface).asKmp() } + } + + actual fun createLayerConfig(identifier: String): KMTiled2dMapLayerConfig? { + val result = native.createLayerConfig(identifier) + return result?.let { (it as MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol).asKmp() } + } + + actual fun createLayerConfigTimed(identifier: String, numT: Int): KMTiled2dMapLayerConfig? { + val result = native.createLayerConfigTimed(identifier, numT) + return result?.let { (it as MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol).asKmp() } + } + + actual fun createLayerConfigWithZoomInfo(identifier: String, zoomInfo: KMTiled2dMapZoomInfo): KMTiled2dMapLayerConfig? { + val result = native.createLayerConfigWithZoomInfo(identifier, zoomInfo.asPlatform()) + return result?.let { (it as MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol).asKmp() } + } + + actual fun createLayerConfigWithZoomInfoTimed(identifier: String, zoomInfo: KMTiled2dMapZoomInfo, numT: Int): KMTiled2dMapLayerConfig? { + val result = native.createLayerConfigWithZoomInfoTimed(identifier, zoomInfo.asPlatform(), numT) + return result?.let { (it as MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol).asKmp() } + } + + actual fun getAllLayers(): ArrayList { + val result = native.getAllLayers() + return ArrayList(((result as? List<*>)?.map { (it as MapCoreSharedModule.MCWmtsLayerDescription).asKmp() } ?: (0 until (result as platform.Foundation.NSArray).count.toInt()).map { idx -> ((result as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCWmtsLayerDescription).asKmp() })) + } + + actual companion object + { + + actual fun create(xml: String): KMWmtsCapabilitiesResource { + val result = MapCoreSharedModule.MCWmtsCapabilitiesResource.create(xml) + return (result as MapCoreSharedModule.MCWmtsCapabilitiesResource).asKmp() + } + } +} + +internal fun KMWmtsCapabilitiesResource.asPlatform(): MapCoreSharedModule.MCWmtsCapabilitiesResource = nativeHandle as MapCoreSharedModule.MCWmtsCapabilitiesResource +public fun MapCoreSharedModule.MCWmtsCapabilitiesResource.asKmp(): KMWmtsCapabilitiesResource = KMWmtsCapabilitiesResource(this) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDescription.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDescription.kt new file mode 100644 index 000000000..d9788720e --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDescription.kt @@ -0,0 +1,52 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMWmtsLayerDescription", exact = true) +actual class KMWmtsLayerDescription actual public constructor( + identifier: String, + title: String?, + abstractText: String?, + dimensions: ArrayList, + bounds: KMRectCoord?, + tileMatrixSetLink: String, + resourceTemplate: String, + resourceFormat: String, +) { + actual val identifier: String = identifier + actual val title: String? = title + actual val abstractText: String? = abstractText + actual val dimensions: ArrayList = dimensions + actual val bounds: KMRectCoord? = bounds + actual val tileMatrixSetLink: String = tileMatrixSetLink + actual val resourceTemplate: String = resourceTemplate + actual val resourceFormat: String = resourceFormat +} + +internal fun KMWmtsLayerDescription.asPlatform(): MapCoreSharedModule.MCWmtsLayerDescription = MapCoreSharedModule.MCWmtsLayerDescription( + identifier = identifier, + title = title?.let { it }, + abstractText = abstractText?.let { it }, + dimensions = ArrayList(dimensions.map { it.asPlatform() }), + bounds = bounds?.let { it.asPlatform() }, + tileMatrixSetLink = tileMatrixSetLink, + resourceTemplate = resourceTemplate, + resourceFormat = resourceFormat, +) +public fun MapCoreSharedModule.MCWmtsLayerDescription.asKmp(): KMWmtsLayerDescription = KMWmtsLayerDescription( + identifier = this.identifier, + title = this.title?.let { (it as String) }, + abstractText = this.abstractText?.let { (it as String) }, + dimensions = ArrayList(((this.dimensions as? List<*>)?.map { (it as MapCoreSharedModule.MCWmtsLayerDimension).asKmp() } ?: (0 until (this.dimensions as platform.Foundation.NSArray).count.toInt()).map { idx -> ((this.dimensions as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCWmtsLayerDimension).asKmp() })), + bounds = this.bounds?.let { (it as MapCoreSharedModule.MCRectCoord).asKmp() }, + tileMatrixSetLink = this.tileMatrixSetLink, + resourceTemplate = this.resourceTemplate, + resourceFormat = this.resourceFormat, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDimension.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDimension.kt new file mode 100644 index 000000000..083ca28f1 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsLayerDimension.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMWmtsLayerDimension", exact = true) +actual class KMWmtsLayerDimension actual public constructor( + identifier: String, + defaultValue: String, + values: ArrayList, +) { + actual val identifier: String = identifier + actual val defaultValue: String = defaultValue + actual val values: ArrayList = values +} + +internal fun KMWmtsLayerDimension.asPlatform(): MapCoreSharedModule.MCWmtsLayerDimension = MapCoreSharedModule.MCWmtsLayerDimension( + identifier = identifier, + defaultValue = defaultValue, + values = ArrayList(values.map { it }), +) +public fun MapCoreSharedModule.MCWmtsLayerDimension.asKmp(): KMWmtsLayerDimension = KMWmtsLayerDimension( + identifier = this.identifier, + defaultValue = this.defaultValue, + values = ArrayList(((this.values as? List<*>)?.map { (it as String) } ?: (0 until (this.values as platform.Foundation.NSArray).count.toInt()).map { idx -> ((this.values as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as String) })), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrix.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrix.kt new file mode 100644 index 000000000..1052333ae --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrix.kt @@ -0,0 +1,52 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMWmtsTileMatrix", exact = true) +actual class KMWmtsTileMatrix actual public constructor( + identifier: String, + scaleDenominator: Double, + topLeftCornerX: Double, + topLeftCornerY: Double, + tileWidth: Int, + tileHeight: Int, + matrixWidth: Int, + matrixHeight: Int, +) { + actual val identifier: String = identifier + actual val scaleDenominator: Double = scaleDenominator + actual val topLeftCornerX: Double = topLeftCornerX + actual val topLeftCornerY: Double = topLeftCornerY + actual val tileWidth: Int = tileWidth + actual val tileHeight: Int = tileHeight + actual val matrixWidth: Int = matrixWidth + actual val matrixHeight: Int = matrixHeight +} + +internal fun KMWmtsTileMatrix.asPlatform(): MapCoreSharedModule.MCWmtsTileMatrix = MapCoreSharedModule.MCWmtsTileMatrix( + identifier = identifier, + scaleDenominator = scaleDenominator, + topLeftCornerX = topLeftCornerX, + topLeftCornerY = topLeftCornerY, + tileWidth = tileWidth, + tileHeight = tileHeight, + matrixWidth = matrixWidth, + matrixHeight = matrixHeight, +) +public fun MapCoreSharedModule.MCWmtsTileMatrix.asKmp(): KMWmtsTileMatrix = KMWmtsTileMatrix( + identifier = this.identifier, + scaleDenominator = this.scaleDenominator, + topLeftCornerX = this.topLeftCornerX, + topLeftCornerY = this.topLeftCornerY, + tileWidth = this.tileWidth, + tileHeight = this.tileHeight, + matrixWidth = this.matrixWidth, + matrixHeight = this.matrixHeight, +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrixSet.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrixSet.kt new file mode 100644 index 000000000..ce2cbca34 --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTileMatrixSet.kt @@ -0,0 +1,32 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMWmtsTileMatrixSet", exact = true) +actual class KMWmtsTileMatrixSet actual public constructor( + identifier: String, + coordinateSystemIdentifier: Int, + matrices: ArrayList, +) { + actual val identifier: String = identifier + actual val coordinateSystemIdentifier: Int = coordinateSystemIdentifier + actual val matrices: ArrayList = matrices +} + +internal fun KMWmtsTileMatrixSet.asPlatform(): MapCoreSharedModule.MCWmtsTileMatrixSet = MapCoreSharedModule.MCWmtsTileMatrixSet( + identifier = identifier, + coordinateSystemIdentifier = coordinateSystemIdentifier, + matrices = ArrayList(matrices.map { it.asPlatform() }), +) +public fun MapCoreSharedModule.MCWmtsTileMatrixSet.asKmp(): KMWmtsTileMatrixSet = KMWmtsTileMatrixSet( + identifier = this.identifier, + coordinateSystemIdentifier = this.coordinateSystemIdentifier, + matrices = ArrayList(((this.matrices as? List<*>)?.map { (it as MapCoreSharedModule.MCWmtsTileMatrix).asKmp() } ?: (0 until (this.matrices as platform.Foundation.NSArray).count.toInt()).map { idx -> ((this.matrices as platform.Foundation.NSArray).objectAtIndex(idx.toULong()) as MapCoreSharedModule.MCWmtsTileMatrix).asKmp() })), +) diff --git a/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTiled2dMapLayerConfigFactory.kt b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTiled2dMapLayerConfigFactory.kt new file mode 100644 index 000000000..616563e7f --- /dev/null +++ b/bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMWmtsTiled2dMapLayerConfigFactory.kt @@ -0,0 +1,30 @@ +// AUTOGENERATED FILE - DO NOT MODIFY! +// This file was generated by Djinni from wmts_capabilities.djinni + +@file:Suppress("RedundantCast", "RedundantCallOfConversionMethod", "USELESS_CAST") + +package io.openmobilemaps.mapscore.kmp + +import kotlin.experimental.ExperimentalObjCName +import kotlin.native.ObjCName + +@OptIn(ExperimentalObjCName::class) +@ObjCName("KMWmtsTiled2dMapLayerConfigFactory", exact = true) +actual class KMWmtsTiled2dMapLayerConfigFactory actual public constructor( + nativeHandle: Any, +) { + internal val nativeHandle: Any = nativeHandle + private val native = nativeHandle as MapCoreSharedModule.MCWmtsTiled2dMapLayerConfigFactory + + actual companion object + { + + actual fun create(wmtsLayerConfiguration: KMWmtsLayerDescription, zoomLevelInfo: ArrayList, zoomInfo: KMTiled2dMapZoomInfo, coordinateSystemIdentifier: Int, matrixSetIdentifier: String): KMTiled2dMapLayerConfig { + val result = MapCoreSharedModule.MCWmtsTiled2dMapLayerConfigFactory.create(wmtsLayerConfiguration.asPlatform(), ArrayList(zoomLevelInfo.map { it.asPlatform() }), zoomInfo.asPlatform(), coordinateSystemIdentifier, matrixSetIdentifier) + return (result as MapCoreSharedModule.MCTiled2dMapLayerConfigProtocol).asKmp() + } + } +} + +internal fun KMWmtsTiled2dMapLayerConfigFactory.asPlatform(): MapCoreSharedModule.MCWmtsTiled2dMapLayerConfigFactory = nativeHandle as MapCoreSharedModule.MCWmtsTiled2dMapLayerConfigFactory +public fun MapCoreSharedModule.MCWmtsTiled2dMapLayerConfigFactory.asKmp(): KMWmtsTiled2dMapLayerConfigFactory = KMWmtsTiled2dMapLayerConfigFactory(this) diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..ed8794cde --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,668 @@ +@file:Suppress("DEPRECATION") +@file:OptIn(ExperimentalSpmForKmpFeature::class) + +import io.github.frankois944.spmForKmp.swiftPackageConfig +import io.github.frankois944.spmForKmp.utils.ExperimentalSpmForKmpFeature +import org.gradle.api.DefaultTask +import org.gradle.api.file.ConfigurableFileCollection +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.provider.Property +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.InputDirectory +import org.gradle.api.tasks.InputFile +import org.gradle.api.tasks.InputFiles +import org.gradle.api.tasks.Internal +import org.gradle.api.tasks.Optional +import org.gradle.api.tasks.OutputDirectory +import org.gradle.api.tasks.OutputFile +import org.gradle.api.tasks.CacheableTask +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity +import org.gradle.api.tasks.TaskAction +import org.gradle.process.ExecOperations +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget +import org.jetbrains.kotlin.gradle.tasks.CInteropProcess +import java.io.ByteArrayOutputStream +import javax.inject.Inject + +group = "io.openmobilemaps.mapscore" + +val mapCoreCheckoutPath = project.layout.projectDirectory.asFile.absolutePath +val mapCoreMetalToolchain = providers.environmentVariable("MAPCORE_METAL_TOOLCHAIN") + .orElse(providers.gradleProperty("mapCoreMetalToolchain")) + .orElse("") +val mapCoreMetallibToolchain = providers.environmentVariable("MAPCORE_METALLIB_TOOLCHAIN") + .orElse(providers.gradleProperty("mapCoreMetallibToolchain")) + .orElse("com.apple.dt.toolchain.XcodeDefault") +val mapCoreMetalTargetSimulator = providers.environmentVariable("MAPCORE_METAL_TARGET_SIMULATOR") + .orElse(providers.gradleProperty("mapCoreMetalTargetSimulator")) + .orElse("air64-apple-ios26.0-simulator") +val mapCoreMetalTargetDevice = providers.environmentVariable("MAPCORE_METAL_TARGET_DEVICE") + .orElse(providers.gradleProperty("mapCoreMetalTargetDevice")) + .orElse("air64-apple-ios26.0") +val mapCoreSpmBuildType = (project.findProperty("KOTLIN_FRAMEWORK_BUILD_TYPE") as? String) + ?.lowercase() + ?.takeIf { it == "debug" || it == "release" } + ?: "release" +val mapCoreSpmScratchDir = project.layout.buildDirectory.dir("spmKmpPlugin/MapCoreKmp/scratch") +val isIosOnlyInvocationFromRoot = System.getProperty("b2g.iosOnlyInvocation")?.toBoolean() == true +val requestedTasksLower = gradle.startParameter.taskNames.map { it.lowercase() } +val isIosOnlyInvocation = + isIosOnlyInvocationFromRoot || + ( + requestedTasksLower.isNotEmpty() && + requestedTasksLower.all { task -> + val looksLikeIosTask = + task.contains("ios") || + task.contains("swiftpackage") || + task.contains("xcode") || + task.contains("cinterop") + val looksLikeAndroidTask = + task.contains("android") || + task.contains("assemble") || + task.contains("bundle") || + task.contains("lint") || + task.contains("install") || + task.contains("connected") + looksLikeIosTask && !looksLikeAndroidTask + } + ) +val isAndroidOrIdeInvocation = + requestedTasksLower.any { task -> + task.contains("android") || + task.contains("assemble") || + task.contains("bundle") || + task.contains("lint") || + task.contains("install") || + task.contains("connected") || + task.contains("preparekotlinbuildscriptmodel") || + task.contains("kotlinbuildscriptmodel") + } +val skipIosTasksForCurrentInvocation = !isIosOnlyInvocation && isAndroidOrIdeInvocation + +plugins { + id("org.jetbrains.kotlin.multiplatform") version "2.3.0" + id("com.android.library") version "8.13.2" + id("maven-publish") + id("io.github.frankois944.spmForKmp") version "1.4.6" +} + +@OptIn(ExperimentalKotlinGradlePluginApi::class) +kotlin { + compilerOptions { + freeCompilerArgs.add("-Xexpect-actual-classes") // Opt-in for expect/actual classes + } + + applyDefaultHierarchyTemplate() + + androidTarget { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) + } + publishLibraryVariants("debug", "release") + } + + val mapCoreCinteropName = "MapCoreKmp" + val iosTargets = listOf( + iosArm64(), + iosSimulatorArm64() + ) + + iosTargets.forEach { iosTarget -> + iosTarget.binaries.framework { + isStatic = true + } + iosTarget.compilations { + val main by getting { + cinterops.create(mapCoreCinteropName) + } + } + iosTarget.swiftPackageConfig(cinteropName = mapCoreCinteropName) { + customPackageSourcePath = "$mapCoreCheckoutPath/kmp" + minIos = "16.4" + debug = mapCoreSpmBuildType == "debug" + bridgeSettings { + cSetting { + headerSearchPath = listOf("Sources/djinni-objc") + } + } + dependency { + localPackage( + mapCoreCheckoutPath, + "maps-core" + ) { + add("MapCore") + add("MapCoreSharedModule", exportToKotlin = true) + } + } + } + } + + sourceSets { + val commonMain by getting { + kotlin.srcDir("bridging/kmp/commonMain/kotlin") + kotlin.srcDir("kmp/commonMain/kotlin") + dependencies { + api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2") + } + } + val androidMain by getting { + kotlin.srcDir("bridging/kmp/androidMain/kotlin") + kotlin.srcDir("kmp/androidMain/kotlin") + dependencies { + api("io.openmobilemaps:mapscore:3.6.0") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.9.3") + implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.3") + implementation("ch.ubique.android:djinni-support-lib:1.1.1") + } + } + val iosMain by getting { + kotlin.srcDir("bridging/kmp/iosMain/kotlin") + kotlin.srcDir("kmp/iosMain/kotlin") + languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi") + } + val iosArm64Main by getting { + languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi") + } + val iosSimulatorArm64Main by getting { + languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi") + } + } +} + +android { + namespace = "io.openmobilemaps.mapscore.kmp" + compileSdk = 36 + defaultConfig { + minSdk = 28 + } +} + +abstract class CheckMapCoreGitTagTask : DefaultTask() { + @get:Internal + abstract val repoDir: DirectoryProperty + + @get:Inject + abstract val execOperations: ExecOperations + + @TaskAction + fun run() { + val stderr = ByteArrayOutputStream() + val result = + execOperations.exec { + workingDir(repoDir.get().asFile) + commandLine("git", "describe", "--tags", "--exact-match", "HEAD") + isIgnoreExitValue = true + errorOutput = stderr + } + if (result.exitValue == 0) return + val errorText = stderr.toString().trim() + val detail = if (errorText.isNotBlank()) ": $errorText" else "" + val warningMessage = + "MapCore KMP build: current commit is not tagged. " + + "Please use a release-tagged version of maps-core. " + + "(git describe --tags --exact-match HEAD failed$detail)" + val buildFilePath = project.layout.projectDirectory.file("build.gradle.kts").asFile.absolutePath + println("$buildFilePath:1: warning: $warningMessage") + } +} + +abstract class CopyFileIfExistsTask : DefaultTask() { + @get:InputFile + @get:Optional + abstract val sourceFile: RegularFileProperty + + @get:OutputFile + abstract val targetFile: RegularFileProperty + + @TaskAction + fun run() { + val source = sourceFile.orNull?.asFile ?: return + if (!source.exists()) return + val target = targetFile.get().asFile + target.parentFile.mkdirs() + source.copyTo(target, overwrite = true) + } +} + +abstract class RewriteMapCorePackageManifestTask : DefaultTask() { + @get:InputFile + @get:Optional + abstract val packageFile: RegularFileProperty + + @TaskAction + fun run() { + val file = packageFile.orNull?.asFile ?: return + if (!file.exists()) return + val original = file.readText() + var updated = original.replace("type: .dynamic", "type: .static") + updated = + updated.replace( + ".product(name: \"MapCore\", package: \"maps-core\"),.product(name: \"MapCoreSharedModule\", package: \"maps-core\")", + ".product(name: \"MapCore\", package: \"maps-core\")", + ) + updated = + updated.replace( + ".product(name: \"MapCore\", package: \"maps-core\"), .product(name: \"MapCoreSharedModule\", package: \"maps-core\")", + ".product(name: \"MapCore\", package: \"maps-core\")", + ) + if (!updated.contains("linkerSettings:")) { + updated = + updated.replace( + ",cSettings: [.headerSearchPath(\"Sources/djinni-objc\")]", + ",cSettings: [.headerSearchPath(\"Sources/djinni-objc\")],linkerSettings: [.linkedLibrary(\"objc\"),.linkedFramework(\"Foundation\")]", + ) + } + if (updated != original) { + file.writeText(updated) + } + } +} + +abstract class PatchMapCoreCInteropDefsTask : DefaultTask() { + @get:Internal + abstract val buildDirRoot: DirectoryProperty + + @get:Input + abstract val targetDirName: Property + + @get:Input + abstract val platformDirName: Property + + @get:Input + abstract val buildType: Property + + @TaskAction + fun run() { + val buildRoot = buildDirRoot.get().asFile + val targetDir = targetDirName.get() + val platformDir = platformDirName.get() + val type = buildType.get() + val libDir = File(buildRoot, "spmKmpPlugin/MapCoreKmp/scratch/$platformDir/$type") + val defRoot = File(buildRoot, "spmKmpPlugin/MapCoreKmp/defFiles/$targetDir") + val defNames = listOf("MapCoreSharedModule", "MapCoreKmp_bridge", "MapCoreKmp") + + defNames.forEach { defName -> + val defFile = File(defRoot, "$defName.def") + if (!defFile.exists()) return@forEach + val extraOpts = + when (defName) { + "MapCoreKmp_bridge" -> listOf("-L\"${libDir.absolutePath}\"", "-lMapCoreKmp") + else -> emptyList() + } + if (extraOpts.isNotEmpty()) { + ensureLinkerOpts(defFile, extraOpts) + } + stripLinkerOpts(defFile, setOf("-lMapCoreSharedModule")) + } + } + + private fun ensureLinkerOpts(defFile: File, opts: List) { + val lines = defFile.readLines().toMutableList() + val idx = lines.indexOfFirst { it.trimStart().startsWith("linkerOpts") } + val optsText = opts.joinToString(" ") + if (idx >= 0) { + val current = lines[idx] + val missing = opts.filterNot { current.contains(it) } + if (missing.isNotEmpty()) { + lines[idx] = current + " " + missing.joinToString(" ") + } + } else { + lines.add("linkerOpts = $optsText") + } + defFile.writeText(lines.joinToString("\n")) + } + + private fun stripLinkerOpts(defFile: File, optsToRemove: Set) { + val lines = defFile.readLines().toMutableList() + val idx = lines.indexOfFirst { it.trimStart().startsWith("linkerOpts") } + if (idx < 0) return + val line = lines[idx] + val prefix = line.substringBefore("=").trimEnd() + " =" + val tokens = line.substringAfter("=").trim().split(Regex("\\s+")) + val filtered = tokens.filterNot { it in optsToRemove } + if (filtered.isEmpty()) { + lines.removeAt(idx) + } else { + lines[idx] = "$prefix ${filtered.joinToString(" ")}" + } + defFile.writeText(lines.joinToString("\n")) + } +} + +abstract class CopyDirectoryContentsIfExistsTask : DefaultTask() { + @get:InputDirectory + @get:Optional + @get:PathSensitive(PathSensitivity.RELATIVE) + abstract val sourceDir: DirectoryProperty + + @get:OutputDirectory + abstract val targetDir: DirectoryProperty + + @TaskAction + fun run() { + val sourceRoot = sourceDir.orNull?.asFile ?: return + if (!sourceRoot.exists()) return + val targetRoot = targetDir.get().asFile + targetRoot.mkdirs() + + sourceRoot.walkTopDown().forEach { source -> + val relativePath = source.relativeTo(sourceRoot).path + if (relativePath.isEmpty()) return@forEach + val target = File(targetRoot, relativePath) + if (source.isDirectory) { + target.mkdirs() + } else { + target.parentFile.mkdirs() + source.copyTo(target, overwrite = true) + } + } + } +} + +val checkMapCoreGitTag = tasks.register("checkMapCoreGitTag") { + group = "verification" + description = "Warn if the current maps-core commit does not have a tag." + repoDir.set(project.layout.projectDirectory) +} + +tasks.matching { it.name.startsWith("compileKotlin") } + .configureEach { dependsOn(checkMapCoreGitTag) } +tasks + .matching { it.name.startsWith("SwiftPackageConfigAppleMapCoreKmpCompileSwiftPackage") } + .configureEach { dependsOn(checkMapCoreGitTag) } +tasks.matching { it.name == "build" || it.name == "assemble" } + .configureEach { dependsOn(checkMapCoreGitTag) } +tasks.matching { it.name == "kmpPartiallyResolvedDependenciesChecker" } + .configureEach { + enabled = !isIosOnlyInvocation + } + +// spmForKmp tasks still use non-cache-safe execution APIs. Keep them functional while +// allowing configuration cache reuse for compatible task graphs. +tasks + .matching { it.name.startsWith("SwiftPackageConfigAppleMapCoreKmp") } + .configureEach { + notCompatibleWithConfigurationCache( + "spmForKmp tasks access task/project state during execution", + ) + } +if (skipIosTasksForCurrentInvocation) { + tasks.configureEach { + val taskName = name.lowercase() + val isIosSpecificTask = + taskName.contains("ios") || + taskName.startsWith("swiftpackageconfigapplemapcorekmp") || + taskName.contains("mapcoremetallib") || + taskName.startsWith("syncmapcorepackageresolvedios") + if (isIosSpecificTask) { + enabled = false + } + } +} + +// Avoid overlapping Package.resolved outputs between per-target SwiftPM compile tasks. +val syncPackageResolvedIosArm64 = tasks.register("syncMapCorePackageResolvedIosArm64") { + sourceFile.set(project.layout.buildDirectory.file("spmKmpPlugin/MapCoreKmp/Package.resolved")) + targetFile.set( + project.layout.buildDirectory.file( + "spmKmpPlugin/MapCoreKmp/package-resolved/SwiftPackageConfigAppleMapCoreKmpCompileSwiftPackageIosArm64/Package.resolved", + ), + ) +} +val syncPackageResolvedIosSimulatorArm64 = + tasks.register("syncMapCorePackageResolvedIosSimulatorArm64") { + sourceFile.set(project.layout.buildDirectory.file("spmKmpPlugin/MapCoreKmp/Package.resolved")) + targetFile.set( + project.layout.buildDirectory.file( + "spmKmpPlugin/MapCoreKmp/package-resolved/SwiftPackageConfigAppleMapCoreKmpCompileSwiftPackageIosSimulatorArm64/Package.resolved", + ), + ) + } +listOf(syncPackageResolvedIosArm64, syncPackageResolvedIosSimulatorArm64).forEach { syncTask -> + syncTask.configure { + mustRunAfter("SwiftPackageConfigAppleMapCoreKmpCompileSwiftPackageIosArm64") + mustRunAfter("SwiftPackageConfigAppleMapCoreKmpCompileSwiftPackageIosSimulatorArm64") + } +} + +tasks.matching { it.name == "SwiftPackageConfigAppleMapCoreKmpCompileSwiftPackageIosArm64" } + .configureEach { + val packageResolveFileGetter = javaClass.methods.firstOrNull { it.name == "getPackageResolveFile" } + val packageResolveProperty = + packageResolveFileGetter + ?.invoke(this) as? RegularFileProperty + packageResolveProperty?.set(syncPackageResolvedIosArm64.flatMap { it.targetFile }) + finalizedBy(syncPackageResolvedIosArm64) + } +tasks.matching { it.name == "SwiftPackageConfigAppleMapCoreKmpCompileSwiftPackageIosSimulatorArm64" } + .configureEach { + val packageResolveFileGetter = javaClass.methods.firstOrNull { it.name == "getPackageResolveFile" } + val packageResolveProperty = + packageResolveFileGetter + ?.invoke(this) as? RegularFileProperty + packageResolveProperty?.set(syncPackageResolvedIosSimulatorArm64.flatMap { it.targetFile }) + finalizedBy(syncPackageResolvedIosSimulatorArm64) + } + +// Ensure MapCoreKmp is built as a static SwiftPM library; MapCore symbols should be provided by the host app. +val rewriteMapCorePackageManifest = tasks.register("rewriteMapCorePackageManifest") { + packageFile.set(project.layout.buildDirectory.file("spmKmpPlugin/MapCoreKmp/Package.swift")) +} +tasks.matching { it.name.startsWith("SwiftPackageConfigAppleMapCoreKmpGenerateSwiftPackage") } + .configureEach { finalizedBy(rewriteMapCorePackageManifest) } + +// SwiftPM emits libMapCoreKmp.a for static builds (debug + release). +val patchMapCoreCInteropDefsIosArm64 = tasks.register("patchMapCoreCInteropDefsIosArm64") { + buildDirRoot.set(project.layout.buildDirectory) + targetDirName.set("iosArm64") + platformDirName.set("arm64-apple-ios") + buildType.set(mapCoreSpmBuildType) +} +val patchMapCoreCInteropDefsIosSimulatorArm64 = + tasks.register("patchMapCoreCInteropDefsIosSimulatorArm64") { + buildDirRoot.set(project.layout.buildDirectory) + targetDirName.set("iosSimulatorArm64") + platformDirName.set("arm64-apple-ios-simulator") + buildType.set(mapCoreSpmBuildType) + } + +tasks.matching { it.name == "SwiftPackageConfigAppleMapCoreKmpGenerateCInteropDefinitionIosArm64" } + .configureEach { + val compiledBinaryProp = + javaClass.getMethod("getCompiledBinary").invoke(this) as RegularFileProperty + compiledBinaryProp.set( + project.layout.buildDirectory.file( + "spmKmpPlugin/MapCoreKmp/scratch/arm64-apple-ios/$mapCoreSpmBuildType/libMapCoreKmp.a", + ), + ) + finalizedBy(patchMapCoreCInteropDefsIosArm64) + } +tasks.matching { it.name == "SwiftPackageConfigAppleMapCoreKmpGenerateCInteropDefinitionIosSimulatorArm64" } + .configureEach { + val compiledBinaryProp = + javaClass.getMethod("getCompiledBinary").invoke(this) as RegularFileProperty + compiledBinaryProp.set( + project.layout.buildDirectory.file( + "spmKmpPlugin/MapCoreKmp/scratch/arm64-apple-ios-simulator/$mapCoreSpmBuildType/libMapCoreKmp.a", + ), + ) + finalizedBy(patchMapCoreCInteropDefsIosSimulatorArm64) + } + +tasks.withType().configureEach { + if (name.contains("MapCore")) { + settings.compilerOpts("-I$mapCoreCheckoutPath/external/djinni/support-lib/objc") + settings.compilerOpts("-I$mapCoreCheckoutPath/bridging/ios") + } +} + +val mapCoreSpmBuiltDir = + project.layout.buildDirectory.dir("spmKmpPlugin/MapCoreKmp/scratch/arm64 x86_64-apple-ios-simulator/$mapCoreSpmBuildType").get().asFile +mapCoreSpmBuiltDir.mkdirs() + +val mapCoreSpmDeviceDir = + project.layout.buildDirectory.dir("spmKmpPlugin/MapCoreKmp/scratch/arm64-apple-ios/$mapCoreSpmBuildType") +val mapCoreSpmSimulatorDir = + project.layout.buildDirectory.dir("spmKmpPlugin/MapCoreKmp/scratch/arm64-apple-ios-simulator/$mapCoreSpmBuildType") + +afterEvaluate { + val deviceTaskName = "SwiftPackageConfigAppleMapCoreKmpCompileSwiftPackageIosArm64" + val simulatorTaskName = "SwiftPackageConfigAppleMapCoreKmpCompileSwiftPackageIosSimulatorArm64" + if (tasks.findByName(deviceTaskName) != null) return@afterEvaluate + runCatching { + tasks.register(deviceTaskName) { + group = "io.github.frankois944.spmForKmp.tasks" + description = "Fallback: copy simulator SwiftPM output for iOS device metal compilation" + dependsOn(simulatorTaskName) + sourceDir.set(mapCoreSpmSimulatorDir) + targetDir.set(mapCoreSpmDeviceDir) + } + }.onFailure { error -> + val message = error.message.orEmpty() + if (!message.contains("already exists")) { + throw error + } + } +} + +@CacheableTask +abstract class CompileMapCoreMetallibTask : DefaultTask() { + @get:Input + abstract val sdk: Property + + @get:Input + abstract val toolchainId: Property + + @get:Input + abstract val metallibToolchainId: Property + + @get:Input + abstract val targetTriple: Property + + @get:InputDirectory + @get:Optional + @get:PathSensitive(PathSensitivity.RELATIVE) + abstract val bundleDir: DirectoryProperty + + @get:InputFiles + @get:PathSensitive(PathSensitivity.RELATIVE) + abstract val metalSources: ConfigurableFileCollection + + @get:OutputDirectory + abstract val outputDir: DirectoryProperty + + @get:OutputFile + abstract val metallibFile: RegularFileProperty + + @get:Inject + abstract val execOperations: ExecOperations + + @TaskAction + fun run() { + val bundleRoot = bundleDir.get().asFile + if (!bundleRoot.exists()) return + val metalFiles = metalSources.files.sortedBy { it.name } + if (metalFiles.isEmpty()) return + val toolchain = toolchainId.orNull?.takeIf { it.isNotBlank() } + val metallibToolchain = metallibToolchainId.orNull?.takeIf { it.isNotBlank() } + + val outputRoot = outputDir.get().asFile + outputRoot.mkdirs() + + val airFiles = metalFiles.map { file -> + File(outputRoot, "${file.nameWithoutExtension}.air") + } + + metalFiles.zip(airFiles).forEach { (metalFile, airFile) -> + execOperations.exec { + val args = buildList { + add("xcrun") + if (toolchain != null) { + add("--toolchain") + add(toolchain) + } + addAll( + listOf( + "-sdk", + sdk.get(), + "metal", + "-target", + targetTriple.get(), + "-c", + metalFile.absolutePath, + "-o", + airFile.absolutePath, + ), + ) + } + commandLine(args) + } + } + + val metallibArgs = buildList { + add("xcrun") + if (metallibToolchain != null) { + add("--toolchain") + add(metallibToolchain) + } + addAll( + listOf( + "-sdk", + sdk.get(), + "metallib", + ), + ) + airFiles.forEach { add(it.absolutePath) } + add("-o") + add(metallibFile.get().asFile.absolutePath) + } + + execOperations.exec { + commandLine(metallibArgs) + } + } +} + +val compileMapCoreMetallibIosSimulator = tasks.register("compileMapCoreMetallibIosSimulator") { + dependsOn("SwiftPackageConfigAppleMapCoreKmpCompileSwiftPackageIosSimulatorArm64") + sdk.set("iphonesimulator") + toolchainId.set(mapCoreMetalToolchain) + metallibToolchainId.set(mapCoreMetallibToolchain) + targetTriple.set(mapCoreMetalTargetSimulator) + bundleDir.set( + project.layout.buildDirectory + .dir("spmKmpPlugin/MapCoreKmp/scratch/arm64-apple-ios-simulator/$mapCoreSpmBuildType/MapCore_MapCore.bundle"), + ) + outputDir.set(project.layout.buildDirectory.dir("spmKmpPlugin/MapCoreKmp/metal/iphonesimulator")) + metalSources.from(bundleDir.map { it.asFileTree.matching { include("**/*.metal") } }) + metallibFile.set(bundleDir.map { it.file("default.metallib") }) +} + +val compileMapCoreMetallibIosArm64 = tasks.register("compileMapCoreMetallibIosArm64") { + dependsOn("SwiftPackageConfigAppleMapCoreKmpCompileSwiftPackageIosArm64") + sdk.set("iphoneos") + toolchainId.set(mapCoreMetalToolchain) + metallibToolchainId.set(mapCoreMetallibToolchain) + targetTriple.set(mapCoreMetalTargetDevice) + bundleDir.set( + project.layout.buildDirectory + .dir("spmKmpPlugin/MapCoreKmp/scratch/arm64-apple-ios/$mapCoreSpmBuildType/MapCore_MapCore.bundle"), + ) + outputDir.set(project.layout.buildDirectory.dir("spmKmpPlugin/MapCoreKmp/metal/iphoneos")) + metalSources.from(bundleDir.map { it.asFileTree.matching { include("**/*.metal") } }) + metallibFile.set(bundleDir.map { it.file("default.metallib") }) +} + +tasks.matching { it.name == "SwiftPackageConfigAppleMapCoreKmpCopyPackageResourcesIosSimulatorArm64" } + .configureEach { dependsOn(compileMapCoreMetallibIosSimulator) } +tasks.matching { it.name == "SwiftPackageConfigAppleMapCoreKmpCopyPackageResourcesIosArm64" } + .configureEach { dependsOn(compileMapCoreMetallibIosArm64) } + +tasks.matching { it.name == "compileKotlinIosSimulatorArm64" } + .configureEach { dependsOn(compileMapCoreMetallibIosSimulator) } +tasks.matching { it.name == "compileKotlinIosArm64" } + .configureEach { dependsOn(compileMapCoreMetallibIosArm64) } diff --git a/djinni/run_djinni.sh b/djinni/run_djinni.sh index 75139485d..c26743775 100755 --- a/djinni/run_djinni.sh +++ b/djinni/run_djinni.sh @@ -14,6 +14,7 @@ while [ -h "$loc" ]; do fi done base_dir=$(cd "$(dirname "$loc")" && pwd) +cd "$base_dir" JAVA_PACKAGE="io.openmobilemaps.mapscore.shared" PROJECT_PREFIX="MC" @@ -30,6 +31,12 @@ JNI_OUT="$DJINNI_OUT_DIR/android/jni" WASM_OUT="$DJINNI_OUT_DIR/wasm" TS_OUT="$DJINNI_OUT_DIR/ts" YAML_OUT="${base_dir}/yaml" +KMP_COMMON_OUT="$base_dir/../bridging/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp" +KMP_ANDROID_OUT="$base_dir/../bridging/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp" +KMP_IOS_OUT="$base_dir/../bridging/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp" +KMP_PACKAGE="io.openmobilemaps.mapscore.kmp" +KMP_IOS_MODULE="MapCoreSharedModule" +KMP_BRIDGE_PREFIX="KM" CPP_OUT="${base_dir}/../shared/public" HPP_EXT="h" @@ -41,7 +48,7 @@ IDENT_CPP_METHOD="fooBar" IDENT_JNI_CLASS="NativeFooBar" IDENT_JAVA="fooBar" -for dir in "$OBJCPP_OUT" "$OBJC_OUT" "$JNI_OUT" "$KOTLIN_OUT" "$WASM_OUT" "$TS_OUT"; do +for dir in "$OBJCPP_OUT" "$OBJC_OUT" "$JNI_OUT" "$KOTLIN_OUT" "$WASM_OUT" "$TS_OUT" "$KMP_COMMON_OUT" "$KMP_ANDROID_OUT" "$KMP_IOS_OUT"; do if [ -e "$dir" ]; then echo "Deleting \"$dir\"..." rm -r "$dir" @@ -85,6 +92,14 @@ for file in $(git ls-files "*.djinni"); do --java-package "$JAVA_PACKAGE$SUBPOINT" \ --ident-java-field "$IDENT_JAVA" \ --ident-java-enum "$IDENT_CPP_ENUM" \ + \ + --kotlin-kmp-common-out "$KMP_COMMON_OUT" \ + --kotlin-kmp-android-out "$KMP_ANDROID_OUT" \ + --kotlin-kmp-ios-out "$KMP_IOS_OUT" \ + --kotlin-kmp-package "$KMP_PACKAGE" \ + --kotlin-kmp-ios-module "$KMP_IOS_MODULE" \ + --kotlin-kmp-bridge-prefix "$KMP_BRIDGE_PREFIX" \ + --kotlin-kmp-objc-name-prefix "$KMP_BRIDGE_PREFIX" \ \ --cpp-out "$CPP_OUT" \ --hpp-ext "$HPP_EXT" \ diff --git a/external/djinni b/external/djinni index b9cbb71f9..647df54f7 160000 --- a/external/djinni +++ b/external/djinni @@ -1 +1 @@ -Subproject commit b9cbb71f97be2c5669c21fa657f8c856fdd613c8 +Subproject commit 647df54f737088b8cf1ccd29b13a45d6766dd7ce diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..b65e5f51d --- /dev/null +++ b/gradle.properties @@ -0,0 +1,2 @@ +android.useAndroidX=true +kotlin.mpp.enableCInteropCommonization=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 000000000..980502d16 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..128196a7a --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.0-milestone-1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 000000000..faf93008b --- /dev/null +++ b/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 000000000..9b42019c7 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/ios/graphics/Helpers/ViewportState.swift b/ios/graphics/Helpers/ViewportState.swift index e07a4eae9..e87212781 100644 --- a/ios/graphics/Helpers/ViewportState.swift +++ b/ios/graphics/Helpers/ViewportState.swift @@ -11,6 +11,7 @@ import Atomics final class ViewportState { + private let packedViewport = ManagedAtomic(0) // MARK: - Writing diff --git a/ios/graphics/Texture/TextureHolder.swift b/ios/graphics/Texture/TextureHolder.swift index 34a2fcd44..f785b812d 100644 --- a/ios/graphics/Texture/TextureHolder.swift +++ b/ios/graphics/Texture/TextureHolder.swift @@ -16,7 +16,7 @@ enum TextureHolderError: Error { case emptyData } -@objc +@objcMembers public class TextureHolder: NSObject, @unchecked Sendable { public let texture: MTLTexture @@ -85,6 +85,15 @@ public class TextureHolder: NSObject, @unchecked Sendable { self.init(texture, textureUsableSize: textureUsableSize) } + @objc(initWithData:) + public convenience init?(data: Data) { + do { + try self.init(data, textureUsableSize: nil) + } catch { + return nil + } + } + public convenience init(_ size: CGSize, drawCallback: (CGContext) -> Void) throws { guard size.width > 0, size.height > 0 else { throw TextureHolderError.emptyData diff --git a/ios/maps/MCFontLoader.swift b/ios/maps/MCFontLoader.swift index 788b5bf70..7a168b7d2 100644 --- a/ios/maps/MCFontLoader.swift +++ b/ios/maps/MCFontLoader.swift @@ -12,6 +12,7 @@ import MapCoreSharedModule import UIKit import os +@objcMembers open class MCFontLoader: NSObject, MCFontLoaderInterface, @unchecked Sendable { // MARK: - Font Atlas Dictionary @@ -22,10 +23,18 @@ open class MCFontLoader: NSObject, MCFontLoaderInterface, @unchecked Sendable { // MARK: - Init private let bundle: Bundle + private let resourcePath: String? // the bundle to use for searching for fonts - public init(bundle: Bundle, preload: [String] = []) { + @objc(initWithBundle:preload:) + public convenience init(bundle: Bundle, preload: [String] = []) { + self.init(bundle: bundle, resourcePath: nil, preload: preload) + } + + @objc(initWithBundle:resourcePath:preload:) + public init(bundle: Bundle, resourcePath: String?, preload: [String] = []) { self.bundle = bundle + self.resourcePath = resourcePath pixelsPerInch = if Thread.isMainThread { MainActor.assumeIsolated { @@ -70,7 +79,7 @@ open class MCFontLoader: NSObject, MCFontLoaderInterface, @unchecked Sendable { if let fontData = fontDataDictionary[font.name] { return fontData } - if let path = bundle.path(forResource: font.name, ofType: "json") { + if let path = fontResourcePath(name: font.name, ext: "json") { do { let data = try Data(contentsOf: URL(fileURLWithPath: path), options: .mappedIfSafe) let jsonResult = try JSONSerialization.jsonObject(with: data, options: .mutableLeaves) @@ -146,16 +155,21 @@ open class MCFontLoader: NSObject, MCFontLoaderInterface, @unchecked Sendable { return fontData } - let image = UIImage(named: font.name, in: bundle, compatibleWith: nil) - - guard let cgImage = image?.cgImage, + guard let path = fontResourcePath(name: font.name, ext: "png"), + let image = UIImage(contentsOfFile: path), + let cgImage = image.cgImage, let textureHolder = try? TextureHolder(cgImage) - else { - return nil - } + else { return nil } fontAtlasDictionary[font.name] = textureHolder return textureHolder } + + private func fontResourcePath(name: String, ext: String) -> String? { + if let resourcePath { + return bundle.path(forResource: name, ofType: ext, inDirectory: resourcePath) + } + return bundle.path(forResource: name, ofType: ext) + } } diff --git a/ios/maps/MCMapView.swift b/ios/maps/MCMapView.swift index e231975e8..d8b31420d 100644 --- a/ios/maps/MCMapView.swift +++ b/ios/maps/MCMapView.swift @@ -13,6 +13,7 @@ import Foundation @preconcurrency import MetalKit import os +@objcMembers open class MCMapView: MTKView { public let mapInterface: MCMapInterface private let renderingContext: RenderingContext @@ -72,6 +73,11 @@ open class MCMapView: MTKView { setup() } + @objc(initWithMapConfig:pixelsPerInch:is3D:) + public convenience init(mapConfig: MCMapConfig, pixelsPerInch: NSNumber?, is3D: Bool) { + self.init(mapConfig: mapConfig, pixelsPerInch: pixelsPerInch?.floatValue, is3D: is3D) + } + @available(*, unavailable) public required init(coder _: NSCoder) { fatalError("init(coder:) has not been implemented") diff --git a/ios/maps/MCTextureLoader.swift b/ios/maps/MCTextureLoader.swift index c4626e708..9a1b3534d 100644 --- a/ios/maps/MCTextureLoader.swift +++ b/ios/maps/MCTextureLoader.swift @@ -16,7 +16,8 @@ import UIKit @available(iOS 14.0, *) private let logger = Logger(subsystem: "maps-core", category: "MCTextureLoader") -open class MCTextureLoader: MCLoaderInterface, @unchecked Sendable { +@objcMembers +open class MCTextureLoader: NSObject, MCLoaderInterface, @unchecked Sendable { public let session: URLSession public var isRasterDebugModeEnabled: Bool @@ -37,6 +38,7 @@ open class MCTextureLoader: MCLoaderInterface, @unchecked Sendable { } isRasterDebugModeEnabled = UserDefaults.standard.bool(forKey: "io.openmobilemaps.debug.rastertiles.enabled") + super.init() } open func loadTexture(_ url: String, etag: String?) -> MCTextureLoaderResult { diff --git a/kmp/MapCoreKmp/MapCoreKmpBridge.swift b/kmp/MapCoreKmp/MapCoreKmpBridge.swift new file mode 100644 index 000000000..5526447be --- /dev/null +++ b/kmp/MapCoreKmp/MapCoreKmpBridge.swift @@ -0,0 +1,28 @@ +import Foundation +import MapCore +import MapCoreSharedModule + +/// Pure swift classes like MCTextureLoader or MCFontLoader can't be created in KMP +/// Bridge helps to expose those APIs. +@objcMembers +public class MapCoreKmpBridge: NSObject { + @objc(createTextureLoader) + public class func createTextureLoader() -> MCLoaderInterface { + return MCTextureLoader() + } + + @objc(createFontLoaderWithBundle:resourcePath:) + public class func createFontLoader(bundle: Bundle, resourcePath: String? = nil) -> MCFontLoaderInterface { + return MCFontLoader(bundle: bundle, resourcePath: resourcePath) + } + + @objc(createFontLoaderWithBundle:) + public class func createFontLoader(bundle: Bundle) -> MCFontLoaderInterface { + return MCFontLoader(bundle: bundle, resourcePath: nil) + } + + @objc(createTextureHolderWithData:) + public class func createTextureHolder(data: Data) -> MCTextureHolderInterface? { + return TextureHolder(data: data) + } +} diff --git a/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataRef.kt b/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataRef.kt new file mode 100644 index 000000000..fd2a0ef9e --- /dev/null +++ b/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataRef.kt @@ -0,0 +1,6 @@ +package io.openmobilemaps.mapscore.kmp + +actual typealias KMDataRef = java.nio.ByteBuffer + +internal fun KMDataRef.asPlatform(): java.nio.ByteBuffer = this +internal fun java.nio.ByteBuffer.asKmp(): KMDataRef = this diff --git a/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFuture.kt b/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFuture.kt new file mode 100644 index 000000000..f9abb7a45 --- /dev/null +++ b/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFuture.kt @@ -0,0 +1,41 @@ +package io.openmobilemaps.mapscore.kmp + +import com.snapchat.djinni.Promise + +actual class KMFuture { + internal val native: com.snapchat.djinni.Future<*>? + + constructor() { + native = null + } + + internal constructor(native: com.snapchat.djinni.Future<*>) { + this.native = native + } +} + +actual class KMPromise { + private val promise: Promise = Promise() + + actual fun setValue(value: T) { + promise.setValue(value) + } + + @Suppress("UNCHECKED_CAST") + actual fun setDataLoaderResult(value: KMDataLoaderResult) { + promise.setValue(value.asPlatform() as T) + } + + @Suppress("UNCHECKED_CAST") + actual fun setTextureLoaderResult(value: KMTextureLoaderResult) { + promise.setValue(value.asPlatform() as T) + } + + actual fun future(): KMFuture = promise.future.asKmp() +} + +@Suppress("UNCHECKED_CAST") +internal fun KMFuture.asPlatform(): com.snapchat.djinni.Future = + requireNotNull(native) as com.snapchat.djinni.Future + +fun com.snapchat.djinni.Future<*>.asKmp(): KMFuture = KMFuture(this) diff --git a/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterfaceBridge.kt b/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterfaceBridge.kt new file mode 100644 index 000000000..30e6ea85e --- /dev/null +++ b/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterfaceBridge.kt @@ -0,0 +1,5 @@ +package io.openmobilemaps.mapscore.kmp + +actual object KMMapInterfaceBridge { + actual fun wrap(nativeHandle: Any): KMMapInterface = KMMapInterface(nativeHandle) +} diff --git a/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/MapCoreKmpInterop.kt b/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/MapCoreKmpInterop.kt new file mode 100644 index 000000000..3d08130b0 --- /dev/null +++ b/kmp/androidMain/kotlin/io/openmobilemaps/mapscore/kmp/MapCoreKmpInterop.kt @@ -0,0 +1,55 @@ +package io.openmobilemaps.mapscore.kmp + +import android.graphics.Bitmap +import android.graphics.BitmapFactory +import android.graphics.ImageDecoder +import android.opengl.GLES20 +import android.os.Build +import android.util.Log +import io.openmobilemaps.mapscore.graphics.BitmapTextureHolder +import io.openmobilemaps.mapscore.graphics.CanvasEdgeFillMode +import java.io.IOException +import java.nio.ByteBuffer + +fun createTextureHolder( + data: KMDataRef, + minFilter: Int = GLES20.GL_LINEAR, + magFilter: Int = GLES20.GL_LINEAR, + edgeFillMode: CanvasEdgeFillMode = CanvasEdgeFillMode.Mirorred, +): KMTextureHolderInterface? { + val bytes = data.toByteArray() + + val bitmap = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + try { + ImageDecoder.decodeBitmap(ImageDecoder.createSource(bytes)) { decoder, info, source -> + decoder.apply { + allocator = ImageDecoder.ALLOCATOR_SOFTWARE + isMutableRequired = true + } + } + } catch (e: IOException) { + Log.e(KMTextureHolderInterface::class.java.canonicalName, "Failed to decode image $data", e) + null + } + } else { + BitmapFactory.decodeByteArray(bytes, 0, bytes.size) + } + + return bitmap?.let { BitmapTextureHolder(it, minFilter, magFilter, edgeFillMode) }?.asKmp() +} + +fun createTextureHolder( + bitmap: Bitmap, + minFilter: Int = GLES20.GL_LINEAR, + magFilter: Int = GLES20.GL_LINEAR, + edgeFillMode: CanvasEdgeFillMode = CanvasEdgeFillMode.Mirorred, +): KMTextureHolderInterface = BitmapTextureHolder(bitmap, minFilter, magFilter, edgeFillMode).asKmp() + + +private fun ByteBuffer.toByteArray(): ByteArray { + val duplicate = duplicate() + duplicate.rewind() + val bytes = ByteArray(duplicate.remaining()) + duplicate.get(bytes) + return bytes +} diff --git a/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataRef.kt b/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataRef.kt new file mode 100644 index 000000000..8f2db2bc2 --- /dev/null +++ b/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataRef.kt @@ -0,0 +1,3 @@ +package io.openmobilemaps.mapscore.kmp + +expect abstract class KMDataRef diff --git a/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFuture.kt b/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFuture.kt new file mode 100644 index 000000000..ea22bf7d0 --- /dev/null +++ b/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFuture.kt @@ -0,0 +1,10 @@ +package io.openmobilemaps.mapscore.kmp + +expect class KMFuture + +expect class KMPromise() { + fun setValue(value: T) + fun setDataLoaderResult(value: KMDataLoaderResult) + fun setTextureLoaderResult(value: KMTextureLoaderResult) + fun future(): KMFuture +} diff --git a/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterfaceBridge.kt b/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterfaceBridge.kt new file mode 100644 index 000000000..c0dc45807 --- /dev/null +++ b/kmp/commonMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterfaceBridge.kt @@ -0,0 +1,5 @@ +package io.openmobilemaps.mapscore.kmp + +expect object KMMapInterfaceBridge { + fun wrap(nativeHandle: Any): KMMapInterface +} diff --git a/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataRef.kt b/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataRef.kt new file mode 100644 index 000000000..adf79139a --- /dev/null +++ b/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMDataRef.kt @@ -0,0 +1,15 @@ +package io.openmobilemaps.mapscore.kmp + +actual abstract class KMDataRef internal constructor() { + internal abstract fun asNSData(): platform.Foundation.NSData +} + +private class KMDataRefPlatformWrapper( + private val nativeHandle: platform.Foundation.NSData, +) : KMDataRef() { + override fun asNSData(): platform.Foundation.NSData = nativeHandle +} + +internal fun KMDataRef.asPlatform(): platform.Foundation.NSData = asNSData() +internal fun platform.Foundation.NSData.asKmp(): KMDataRef = KMDataRefPlatformWrapper(this) +fun platform.Foundation.NSData.toKMDataRef(): KMDataRef = KMDataRefPlatformWrapper(this) diff --git a/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFuture.kt b/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFuture.kt new file mode 100644 index 000000000..4761b92bc --- /dev/null +++ b/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMFuture.kt @@ -0,0 +1,44 @@ +package io.openmobilemaps.mapscore.kmp + +actual class KMFuture { + internal val native: MapCoreSharedModule.DJFuture? + + constructor() { + native = null + } + + internal constructor(native: MapCoreSharedModule.DJFuture) { + this.native = native + } +} + +actual class KMPromise { + private val promise = MapCoreSharedModule.DJPromise() + + actual fun setValue(value: T) { + promise.setValue(value) + } + + fun setValue(value: KMDataLoaderResult) { + promise.setValue(value.asPlatform()) + } + + fun setValue(value: KMTextureLoaderResult) { + promise.setValue(value.asPlatform()) + } + + actual fun setDataLoaderResult(value: KMDataLoaderResult) { + setValue(value) + } + + actual fun setTextureLoaderResult(value: KMTextureLoaderResult) { + setValue(value) + } + + actual fun future(): KMFuture = promise.getFuture().asKmp() +} + +internal fun KMFuture.asPlatform(): MapCoreSharedModule.DJFuture = + requireNotNull(native) + +internal fun MapCoreSharedModule.DJFuture.asKmp(): KMFuture = KMFuture(this) diff --git a/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterfaceBridge.kt b/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterfaceBridge.kt new file mode 100644 index 000000000..30e6ea85e --- /dev/null +++ b/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/KMMapInterfaceBridge.kt @@ -0,0 +1,5 @@ +package io.openmobilemaps.mapscore.kmp + +actual object KMMapInterfaceBridge { + actual fun wrap(nativeHandle: Any): KMMapInterface = KMMapInterface(nativeHandle) +} diff --git a/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/MapCoreKmpInterop.kt b/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/MapCoreKmpInterop.kt new file mode 100644 index 000000000..080ec3ad7 --- /dev/null +++ b/kmp/iosMain/kotlin/io/openmobilemaps/mapscore/kmp/MapCoreKmpInterop.kt @@ -0,0 +1,17 @@ +package io.openmobilemaps.mapscore.kmp + +import MapCoreKmp.MapCoreKmpBridge +import MapCoreSharedModule.MCFontLoaderInterfaceProtocol +import MapCoreSharedModule.MCLoaderInterfaceProtocol +import MapCoreSharedModule.MCTextureHolderInterfaceProtocol +import platform.Foundation.NSBundle +import platform.Foundation.NSData + +fun createTextureLoader(): KMLoaderInterface = + (MapCoreKmpBridge.createTextureLoader() as MCLoaderInterfaceProtocol).asKmp() + +fun createFontLoader(bundle: NSBundle, resourcePath: String? = null): KMFontLoaderInterface = + (MapCoreKmpBridge.createFontLoaderWithBundle(bundle, resourcePath) as MCFontLoaderInterfaceProtocol).asKmp() + +fun createTextureHolder(data: NSData): KMTextureHolderInterface? = + (MapCoreKmpBridge.createTextureHolderWithData(data) as? MCTextureHolderInterfaceProtocol)?.asKmp() diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..9b9dfa89b --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,45 @@ +rootProject.name = "maps-core" + +val requestedTasksLower = gradle.startParameter.taskNames.map { it.lowercase() } +val isIosOnlyInvocationFromProperty = System.getProperty("b2g.iosOnlyInvocation")?.toBoolean() == true +val isIosOnlyInvocationFromTasks = + requestedTasksLower.isNotEmpty() && + requestedTasksLower.all { task -> + val looksLikeIosTask = + task.contains("ios") || + task.contains("swiftpackage") || + task.contains("xcode") || + task.contains("cinterop") + val looksLikeAndroidTask = + task.contains("android") || + task.contains("assemble") || + task.contains("bundle") || + task.contains("lint") || + task.contains("install") || + task.contains("connected") + looksLikeIosTask && !looksLikeAndroidTask + } +val isIosOnlyInvocation = isIosOnlyInvocationFromProperty || isIosOnlyInvocationFromTasks + +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + } +} + +if (!isIosOnlyInvocation) { + includeBuild("android") { + dependencySubstitution { + substitute(module("io.openmobilemaps:mapscore")).using(project(":")) + } + } +}