| // Copyright 2014 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // This file is autogenerated by |
| // /Users/furture/weex- |
| // core2/weex_core/Source/android/jniprebuild/jni_generator.py |
| // For |
| // com/taobao/weex/ui/component/list/template/jni/NativeRenderObjectUtils |
| |
| #ifndef com_taobao_weex_ui_component_list_template_jni_NativeRenderObjectUtils_JNI |
| #define com_taobao_weex_ui_component_list_template_jni_NativeRenderObjectUtils_JNI |
| |
| #include <jni.h> |
| |
| //#include "base/android/jni_int_wrapper.h" |
| |
| // Step 1: forward declarations. |
| namespace { |
| const char kNativeRenderObjectUtilsClassPath[] = |
| "com/taobao/weex/ui/component/list/template/jni/NativeRenderObjectUtils"; |
| // Leaking this jclass as we cannot use LazyInstance from some threads. |
| jclass g_NativeRenderObjectUtils_clazz = NULL; |
| #define NativeRenderObjectUtils_clazz(env) g_NativeRenderObjectUtils_clazz |
| |
| } // namespace |
| |
| static jlong GetRenderObject(JNIEnv* env, jclass jcaller, |
| jstring instanceId, |
| jstring ref); |
| |
| static void UpdateRenderObjectStyle(JNIEnv* env, jclass jcaller, |
| jlong ptr, |
| jstring key, |
| jstring value); |
| |
| static void UpdateRenderObjectAttr(JNIEnv* env, jclass jcaller, |
| jlong ptr, |
| jstring key, |
| jstring value); |
| |
| static jlong CopyRenderObject(JNIEnv* env, jclass jcaller, |
| jlong ptr); |
| |
| static jint LayoutRenderObject(JNIEnv* env, jclass jcaller, |
| jlong ptr, |
| jfloat width, |
| jfloat height); |
| |
| static void AddChildRenderObject(JNIEnv* env, jclass jcaller, |
| jlong parent, |
| jlong child); |
| |
| static jboolean RenderObjectHasNewLayout(JNIEnv* env, jclass jcaller, |
| jlong ptr); |
| |
| static jint RenderObjectChildCount(JNIEnv* env, jclass jcaller, |
| jlong ptr); |
| |
| static jlong RenderObjectGetChild(JNIEnv* env, jclass jcaller, |
| jlong ptr, |
| jint index); |
| |
| static jlong RenderObjectUpdateComponent(JNIEnv* env, jclass jcaller, |
| jlong ptr, |
| jobject component); |
| |
| static void RenderObjectChildWaste(JNIEnv* env, jclass jcaller, |
| jlong ptr, |
| jboolean waster); |
| |
| // Step 2: method stubs. |
| |
| static intptr_t g_NativeRenderObjectUtils_updateComponentSize = 0; |
| static void Java_NativeRenderObjectUtils_updateComponentSize(JNIEnv* env, |
| jobject component, |
| jfloat top, |
| jfloat bottom, |
| jfloat left, |
| jfloat right, |
| jfloat height, |
| jfloat width) { |
| /* Must call RegisterNativesImpl() */ |
| //CHECK_CLAZZ(env, NativeRenderObjectUtils_clazz(env), |
| // NativeRenderObjectUtils_clazz(env)); |
| jmethodID method_id = |
| base::android::GetMethod( |
| env, NativeRenderObjectUtils_clazz(env), |
| base::android::STATIC_METHOD, |
| "updateComponentSize", |
| |
| "(" |
| "Lcom/taobao/weex/ui/component/WXComponent;" |
| "F" |
| "F" |
| "F" |
| "F" |
| "F" |
| "F" |
| ")" |
| "V", |
| &g_NativeRenderObjectUtils_updateComponentSize); |
| |
| env->CallStaticVoidMethod(NativeRenderObjectUtils_clazz(env), |
| method_id, component, top, bottom, left, right, height, width); |
| base::android::CheckException(env); |
| |
| } |
| |
| // Step 3: RegisterNatives. |
| |
| static const JNINativeMethod kMethodsNativeRenderObjectUtils[] = { |
| { "nativeGetRenderObject", |
| "(" |
| "Ljava/lang/String;" |
| "Ljava/lang/String;" |
| ")" |
| "J", reinterpret_cast<void*>(GetRenderObject) }, |
| { "nativeUpdateRenderObjectStyle", |
| "(" |
| "J" |
| "Ljava/lang/String;" |
| "Ljava/lang/String;" |
| ")" |
| "V", reinterpret_cast<void*>(UpdateRenderObjectStyle) }, |
| { "nativeUpdateRenderObjectAttr", |
| "(" |
| "J" |
| "Ljava/lang/String;" |
| "Ljava/lang/String;" |
| ")" |
| "V", reinterpret_cast<void*>(UpdateRenderObjectAttr) }, |
| { "nativeCopyRenderObject", |
| "(" |
| "J" |
| ")" |
| "J", reinterpret_cast<void*>(CopyRenderObject) }, |
| { "nativeLayoutRenderObject", |
| "(" |
| "J" |
| "F" |
| "F" |
| ")" |
| "I", reinterpret_cast<void*>(LayoutRenderObject) }, |
| { "nativeAddChildRenderObject", |
| "(" |
| "J" |
| "J" |
| ")" |
| "V", reinterpret_cast<void*>(AddChildRenderObject) }, |
| { "nativeRenderObjectHasNewLayout", |
| "(" |
| "J" |
| ")" |
| "Z", reinterpret_cast<void*>(RenderObjectHasNewLayout) }, |
| { "nativeRenderObjectChildCount", |
| "(" |
| "J" |
| ")" |
| "I", reinterpret_cast<void*>(RenderObjectChildCount) }, |
| { "nativeRenderObjectGetChild", |
| "(" |
| "J" |
| "I" |
| ")" |
| "J", reinterpret_cast<void*>(RenderObjectGetChild) }, |
| { "nativeRenderObjectUpdateComponent", |
| "(" |
| "J" |
| "Lcom/taobao/weex/ui/component/WXComponent;" |
| ")" |
| "J", reinterpret_cast<void*>(RenderObjectUpdateComponent) }, |
| { "nativeRenderObjectChildWaste", |
| "(" |
| "J" |
| "Z" |
| ")" |
| "V", reinterpret_cast<void*>(RenderObjectChildWaste) }, |
| }; |
| |
| static bool RegisterNativesImpl(JNIEnv* env) { |
| |
| g_NativeRenderObjectUtils_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( |
| base::android::GetClass(env, kNativeRenderObjectUtilsClassPath).Get())); |
| |
| const int kMethodsNativeRenderObjectUtilsSize = |
| sizeof(kMethodsNativeRenderObjectUtils)/sizeof(kMethodsNativeRenderObjectUtils[0]); |
| |
| if (env->RegisterNatives(NativeRenderObjectUtils_clazz(env), |
| kMethodsNativeRenderObjectUtils, |
| kMethodsNativeRenderObjectUtilsSize) < 0) { |
| //jni_generator::HandleRegistrationError( |
| // env, NativeRenderObjectUtils_clazz(env), __FILE__); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| #endif // com_taobao_weex_ui_component_list_template_jni_NativeRenderObjectUtils_JNI |