slot 0.0.1
A real time UI render framework
载入中...
搜索中...
未找到
common.h
浏览该文件的文档.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#pragma once
9#include "ScopedGlobalRef.h"
10#include "ScopedLocalRef.h"
11
13
18 JNIEnv* env,
19 const char* className,
21 size_t numMethods);
22
27 JNIEnv* env,
28 jclass clazz,
29 const char* methodName,
30 const char* methodDescriptor);
31
37 JNIEnv* env,
38 jclass clazz,
39 const char* methodName,
40 const char* methodDescriptor);
41
46 JNIEnv* env,
47 jclass clazz,
48 const char* fieldName,
49 const char* fieldSignature);
50
51// Helper methods to call a non-static method on an object depending on the
52// return type. Each method will abort the execution if an error
53// (such as a Java pending exception) is detected after invoking the
54// Java method.
55#define DEFINE_CALL_METHOD_FOR_PRIMITIVE_INTERFACE(jnitype, readableType) \
56 jnitype call##readableType##Method( \
57 JNIEnv* env, jobject obj, jmethodID methodId, ...)
61
63callStaticObjectMethod(JNIEnv* env, jclass clazz, jmethodID methodId, ...);
64
70
72
73} // namespace facebook::yoga::vanillajni
static JNINativeMethod methods[]
Definition YGJNIVanilla.cpp:765
Definition ScopedGlobalRef.h:49
Definition ScopedLocalRef.h:47
#define DEFINE_CALL_METHOD_FOR_PRIMITIVE_INTERFACE(jnitype, readableType)
Definition common.h:55
Definition common.cpp:10
ScopedLocalRef< jobject > callStaticObjectMethod(JNIEnv *env, jclass clazz, jmethodID methodId,...)
Definition common.cpp:80
ScopedGlobalRef< jobject > newGlobalRef(JNIEnv *env, jobject obj)
Definition common.cpp:89
jmethodID getMethodId(JNIEnv *env, jclass clazz, const char *methodName, const char *methodDescriptor)
Definition common.cpp:38
jfieldID getFieldId(JNIEnv *env, jclass clazz, const char *fieldName, const char *fieldSignature)
Definition common.cpp:48
void registerNatives(JNIEnv *env, const char *className, const JNINativeMethod methods[], size_t numMethods)
Definition common.cpp:12
jmethodID getStaticMethodId(JNIEnv *env, jclass clazz, const char *methodName, const char *methodDescriptor)
Definition common.cpp:27
void * jobject
Definition jni.h:84
jobject jclass
Definition jni.h:85
float jfloat
Definition jni.h:37
int64_t jlong
Definition jni.h:36
struct _jfieldID * jfieldID
Definition jni.h:103
jobject jthrowable
Definition jni.h:97
struct _jmethodID * jmethodID
Definition jni.h:106
Definition jni.h:150
Definition jni.h:129