#include <iostream>
#include "SkCanvas.h"
#include "SkRRect.h"

#include "common.h"
#include "include/oh/OHRenderNode.h"

SKIKO_EXPORT KNativePointer org_jetbrains_skia_OHRenderNode__1nCreateRootRenderNode
  (KNativePointer context, void* callback) {
    auto cb = reinterpret_cast<NodeDrawCallback>(callback);

    auto node = reinterpret_cast<KNativePointer>(OHRenderNode::CreateRootRenderNode(context, cb));
    return node;
}

SKIKO_EXPORT void org_jetbrains_skia_OHRenderNode__1nSetNodeConstructor
  (napi_env env, napi_value fun) {
    OHRenderNode::SetNodeConstructor(env, fun);
    return;
}

SKIKO_EXPORT void org_jetbrains_skia_OHRenderNode__1nRenderNodeDraw
  (napi_env env, napi_value jsCanvas, napi_value jsNode) {
    OHRenderNode::RenderNodeDraw(env, jsCanvas, jsNode);
    return;
}

SKIKO_EXPORT void org_jetbrains_skia_OHRenderNode__1nRenderNodeNotifyRedraw
  (napi_env env, napi_value jsNode) {
    OHRenderNode::RenderNodeNotifyRedraw(env, jsNode);
    return;
}

SKIKO_EXPORT void org_jetbrains_skia_OHRenderNode__1nSetPixelRatio
  (double ratio) {
    OHRenderNode::SetPixelRatio(ratio);
    return;
}

SKIKO_EXPORT void org_jetbrains_skia_OHRenderNode__1nBuildInstance
  (napi_env env, napi_value fun) {
    NodeStatusModify::BuildInstance(env, fun);
    return;
}

