Garbage collection capable wrappers for skia interop

This commit is contained in:
Alexander Gorshenev
2021-05-06 19:11:05 +03:00
parent d9483ccb08
commit 9148094bbd
30 changed files with 1114 additions and 121 deletions
@@ -0,0 +1,15 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlinx.cinterop
import kotlinx.cinterop.CStructVar
interface SkiaRefCnt
interface CPlusPlusClass
abstract class ManagedType<T : CStructVar>(val cpp: T)
val <T : CStructVar> ManagedType<T>.ptr: CPointer<T> get() = this.cpp.ptr
@@ -24,6 +24,10 @@ annotation class CStruct(val spelling: String) {
@Retention(AnnotationRetention.BINARY)
annotation class VarType(val size: Long, val align: Int)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.BINARY)
annotation class CPlusPlusClass
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.BINARY)
annotation class ManagedType