text: #include <iostream>
  #include <jni.h>
  #include "SkPath.h"
  #include "interop.hh"
  
  static void deletePath(SkPath* path) {
      // std::cout << "Deleting [SkPath " << path << "]" << std::endl;
      delete path;
  }
  
  extern "C" JNIEXPORT jlong JNICALL Java_org_jetbrains_skija_Path_nInit(JNIEnv* env, jclass jclass) {
      SkPath* obj = new SkPath();
      return reinterpret_cast<jlong>(obj);
  }
  
  extern "C" JNIEXPORT jlong JNICALL Java_org_jetbrains_skija_Path_nGetNativeFinalizer(JNIEnv* env, jclass jclass) {
      return static_cast<jlong>(reinterpret_cast<uintptr_t>(&deletePath));
  }
  
  extern "C" JNIEXPORT jint JNICALL Java_org_jetbrains_skija_Path_nGetFillType(JNIEnv* env, jclass jclass, jlong ptr) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      return static_cast<jint>(instance->getFillType());
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nSetFillType(JNIEnv* env, jclass jclass, jlong ptr, jint fillType) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->setFillType(static_cast<SkPathFillType>(fillType));
  }
  
  extern "C" JNIEXPORT jfloatArray JNICALL Java_org_jetbrains_skija_Path_nGetBounds(JNIEnv* env, jclass jclass, jlong ptr) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      SkRect bounds = instance->getBounds();
      return javaFloatArray(env, {bounds.left(), bounds.top(), bounds.right(), bounds.bottom()});
  }
  
  extern "C" JNIEXPORT jfloatArray JNICALL Java_org_jetbrains_skija_Path_nComputeTightBounds(JNIEnv* env, jclass jclass, jlong ptr) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      SkRect bounds = instance->computeTightBounds();
      return javaFloatArray(env, {bounds.left(), bounds.top(), bounds.right(), bounds.bottom()});
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nReset(JNIEnv* env, jclass jclass, jlong ptr) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->reset();
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nMoveTo(JNIEnv* env, jclass jclass, jlong ptr, jfloat x, jfloat y) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->moveTo(x, y);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nRMoveTo(JNIEnv* env, jclass jclass, jlong ptr, jfloat dx, jfloat dy) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->rMoveTo(dx, dy);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nLineTo(JNIEnv* env, jclass jclass, jlong ptr, jfloat x, jfloat y) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->lineTo(x, y);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nRLineTo(JNIEnv* env, jclass jclass, jlong ptr, jfloat dx, jfloat dy) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->rLineTo(dx, dy);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nQuadTo(JNIEnv* env, jclass jclass, long ptr, jfloat x1, jfloat y1, jfloat x2, jfloat y2) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->quadTo(x1, y1, x2, y2);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nRQuadTo(JNIEnv* env, jclass jclass, long ptr, jfloat dx1, jfloat dy1, jfloat dx2, jfloat dy2) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->rQuadTo(dx1, dy1, dx2, dy2);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nConicTo(JNIEnv* env, jclass jclass, long ptr, jfloat x1, jfloat y1, jfloat x2, jfloat y2, jfloat w) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->conicTo(x1, y1, x2, y2, w);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nRConicTo(JNIEnv* env, jclass jclass, long ptr, jfloat dx1, jfloat dy1, jfloat dx2, jfloat dy2, jfloat w) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->rConicTo(dx1, dy1, dx2, dy2, w);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nCubicTo(JNIEnv* env, jclass jclass, long ptr, jfloat x1, jfloat y1, jfloat x2, jfloat y2, jfloat x3, jfloat y3) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->cubicTo(x1, y1, x2, y2, x3, y3);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nRCubicTo(JNIEnv* env, jclass jclass, long ptr, jfloat dx1, jfloat dy1, jfloat dx2, jfloat dy2, jfloat dx3, jfloat dy3) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->rCubicTo(dx1, dy1, dx2, dy2, dx3, dy3);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nArcTo(JNIEnv* env, jclass jclass, long ptr, jfloat left, jfloat top, jfloat right, jfloat bottom, jfloat startAngle, jfloat sweepAngle, jboolean forceMoveTo) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->arcTo({left, top, right, bottom}, startAngle, sweepAngle, forceMoveTo);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nTangentArcTo(JNIEnv* env, jclass jclass, long ptr, jfloat x1, jfloat y1, jfloat x2, jfloat y2, jfloat radius) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->arcTo(x1, y1, x2, y2, radius);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nEllipticalArcTo(JNIEnv* env, jclass jclass, long ptr, jfloat rx, jfloat ry, jfloat xAxisRotate, jint size, jint direction, jfloat x, float y) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->arcTo(rx, ry, xAxisRotate, static_cast<SkPath::ArcSize>(size), static_cast<SkPathDirection>(direction), x, y);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nREllipticalArcTo(JNIEnv* env, jclass jclass, long ptr, jfloat rx, jfloat ry, jfloat xAxisRotate, jint size, jint direction, jfloat dx, float dy) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->rArcTo(rx, ry, xAxisRotate, static_cast<SkPath::ArcSize>(size), static_cast<SkPathDirection>(direction), dx, dy);
  }
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nAddPoly
    (JNIEnv* env, jclass jclass, jlong ptr, jfloatArray coords, jboolean close) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      jsize len = env->GetArrayLength(coords);
      jfloat* arr = env->GetFloatArrayElements(coords, 0);
      SkPoint points[len / 2];
      for (int i = 0; i < len / 2; i++)
          points[i] = SkPoint { arr[i * 2], arr[i * 2 + 1] };
      env->ReleaseFloatArrayElements(coords, arr, 0);
      instance->addPoly(points, len / 2, close);
  }
  
  
  extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skija_Path_nClosePath(JNIEnv* env, jclass jclass, jlong ptr) {
      SkPath* instance = reinterpret_cast<SkPath*>(static_cast<uintptr_t>(ptr));
      instance->close();
  }
  