virtual void nativeTimerDestroy(ZF_IN ZFTimer *timer, ZF_IN void *nativeTimer) { JNIEnv *jniEnv = JNIGetJNIEnv(); jobject nativeTimerTmp = ZFCastStatic(jobject, nativeTimer); JNIUtilDeleteGlobalRef(jniEnv, nativeTimerTmp); }
ZFPROTOCOL_IMPLEMENTATION_NAME(ZFUIImageIOImpl_sys_Android)(void) { JNIEnv *jniEnv = JNIGetJNIEnv(); jobject tmp = JNIUtilFindClass(jniEnv, JNIConvertClassNameForFindClass(ZFImpl_sys_Android_JNI_NAME_ZFUIImageIO).c_str()); this->jclsOwner = (jclass)JNIUtilNewGlobalRef(jniEnv, tmp); JNIUtilDeleteLocalRef(jniEnv, tmp); }
zfoverride virtual void protocolOnDealloc(void) { JNIEnv *jniEnv = JNIGetJNIEnv(); JNIUtilDeleteGlobalRef(jniEnv, this->jclsOwner); zfsuper::protocolOnDealloc(); }
ZFPROTOCOL_IMPLEMENTATION_CLASS(ZFUIViewPositionOnScreenImpl_sys_Android)(void) { JNIEnv *jniEnv = JNIGetJNIEnv(); jobject tmp = zfnull; tmp = JNIUtilFindClass(jniEnv, JNIConvertClassNameForFindClass(ZFImpl_sys_Android_JNI_NAME_ZFUIViewPositionOnScreen).c_str()); this->jclsOwner = (jclass)JNIUtilNewGlobalRef(jniEnv, tmp); JNIUtilDeleteLocalRef(jniEnv, tmp); }
void ZFImpl_sys_Android_ZFUISizeFromZFAndroidSize(ZF_OUT ZFUISize &ret, ZF_IN jobject jobjSize) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jclsSize = ZFImpl_sys_Android_jclassZFAndroidSize(); static jfieldID jfIdWidth = JNIUtilGetFieldID(jniEnv, jclsSize, zfTextA("width"), JNIType::S_int.getId()); static jfieldID jfIdHeight = JNIUtilGetFieldID(jniEnv, jclsSize, zfTextA("height"), JNIType::S_int.getId()); ret.width = JNIUtilGetIntField(jniEnv, jobjSize, jfIdWidth); ret.height = JNIUtilGetIntField(jniEnv, jobjSize, jfIdHeight); }
virtual void timerStop(ZF_IN ZFTimer *timer) { JNIEnv *jniEnv = JNIGetJNIEnv(); static jmethodID jmId = JNIUtilGetStaticMethodID(jniEnv, this->jclsOwner, zfTextA("native_timerStop"), JNIGetMethodSig(JNIType::S_void, JNIParamTypeContainer() .add(JNIType::S_object(ZFImpl_sys_Android_JNI_NAME_Object)) ).c_str()); JNIUtilCallStaticVoidMethod(jniEnv, this->jclsOwner, jmId, ZFCastStatic(jobject, timer->nativeTimer())); }
void ZFImpl_sys_Android_ZFUIPointFromZFAndroidPoint(ZF_OUT ZFUIPoint &ret, ZF_IN jobject jobjPoint) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jclsPoint = ZFImpl_sys_Android_jclassZFAndroidPoint(); static jfieldID jfIdX = JNIUtilGetFieldID(jniEnv, jclsPoint, zfTextA("x"), JNIType::S_int.getId()); static jfieldID jfIdY = JNIUtilGetFieldID(jniEnv, jclsPoint, zfTextA("y"), JNIType::S_int.getId()); ret.x = JNIUtilGetIntField(jniEnv, jobjPoint, jfIdX); ret.y = JNIUtilGetIntField(jniEnv, jobjPoint, jfIdY); }
void ZFImpl_sys_Android_stackTracePrint(void) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jcls = JNIUtilFindClass(jniEnv, JNIConvertClassNameForFindClass(ZFImpl_sys_Android_JNI_NAME_ZFAndroidLog).c_str()); static jmethodID jmId = JNIUtilGetStaticMethodID(jniEnv, jcls, zfTextA("stackTracePrint"), JNIGetMethodSig(JNIType::S_void, JNIParamTypeContainer() ).c_str()); JNIUtilCallStaticVoidMethod(jniEnv, jcls, jmId); }
jobject ZFImpl_sys_Android_zfstringToString(ZF_IN const zfchar *s) { ZFSTRINGENCODING_SENSITIVE("use UTF8") JNIEnv *jniEnv = JNIGetJNIEnv(); if(s == zfnull) { s = zfText(""); } return JNIUtilNewStringUTF(jniEnv, s); }
jobject ZFImpl_sys_Android_ZFUISizeToZFAndroidSize(ZF_IN const ZFUISize &size, ZF_IN_OUT jobject jobjSize) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jclsSize = ZFImpl_sys_Android_jclassZFAndroidSize(); static jfieldID jfIdWidth = JNIUtilGetFieldID(jniEnv, jclsSize, zfTextA("width"), JNIType::S_int.getId()); static jfieldID jfIdHeight = JNIUtilGetFieldID(jniEnv, jclsSize, zfTextA("height"), JNIType::S_int.getId()); JNIUtilSetIntField(jniEnv, jobjSize, jfIdWidth, size.width); JNIUtilSetIntField(jniEnv, jobjSize, jfIdHeight, size.height); return jobjSize; }
jobject ZFImpl_sys_Android_ZFUIPointToZFAndroidPoint(ZF_IN const ZFUIPoint &point, ZF_IN_OUT jobject jobjPoint) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jclsPoint = ZFImpl_sys_Android_jclassZFAndroidPoint(); static jfieldID jfIdX = JNIUtilGetFieldID(jniEnv, jclsPoint, zfTextA("x"), JNIType::S_int.getId()); static jfieldID jfIdY = JNIUtilGetFieldID(jniEnv, jclsPoint, zfTextA("y"), JNIType::S_int.getId()); JNIUtilSetIntField(jniEnv, jobjPoint, jfIdX, point.x); JNIUtilSetIntField(jniEnv, jobjPoint, jfIdY, point.y); return jobjPoint; }
jobject ZFImpl_sys_Android_ZFUISizeToZFAndroidSize(ZF_IN const ZFUISize &size) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jclsSize = ZFImpl_sys_Android_jclassZFAndroidSize(); static jmethodID jmId = JNIUtilGetMethodID(jniEnv, jclsSize, JNIConstructorName, JNIGetMethodSig(JNIType::S_void, JNIParamTypeContainer() ).c_str()); jobject jobjSize = JNIUtilNewObject(jniEnv, jclsSize, jmId); return ZFImpl_sys_Android_ZFUISizeToZFAndroidSize(size, jobjSize); }
jobject ZFImpl_sys_Android_ZFUIPointToZFAndroidPoint(ZF_IN const ZFUIPoint &point) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jclsPoint = ZFImpl_sys_Android_jclassZFAndroidPoint(); static jmethodID jmId = JNIUtilGetMethodID(jniEnv, jclsPoint, JNIConstructorName, JNIGetMethodSig(JNIType::S_void, JNIParamTypeContainer() ).c_str()); jobject jobjPoint = JNIUtilNewObject(jniEnv, jclsPoint, jmId); return ZFImpl_sys_Android_ZFUIPointToZFAndroidPoint(point, jobjPoint); }
jobject ZFImpl_sys_Android_ZFUIMarginToZFAndroidMargin(ZF_IN const ZFUIMargin &margin) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jclsMargin = ZFImpl_sys_Android_jclassZFAndroidMargin(); static jmethodID jmId = JNIUtilGetMethodID(jniEnv, jclsMargin, JNIConstructorName, JNIGetMethodSig(JNIType::S_void, JNIParamTypeContainer() ).c_str()); jobject jobjMargin = JNIUtilNewObject(jniEnv, jclsMargin, jmId); return ZFImpl_sys_Android_ZFUIMarginToZFAndroidMargin(margin, jobjMargin); }
zfoverride virtual void protocolOnInit(void) { zfsuper::protocolOnInit(); JNIEnv *jniEnv = JNIGetJNIEnv(); jobject tmp = zfnull; tmp = JNIUtilFindClass(jniEnv, JNIConvertClassNameForFindClass(ZFImpl_sys_Android_JNI_NAME_ZFUITextEdit).c_str()); this->jclsOwner = (jclass)JNIUtilNewGlobalRef(jniEnv, tmp); JNIUtilDeleteLocalRef(jniEnv, tmp); }
virtual void *nativeTimerCreate(ZF_IN ZFTimer *timer) { JNIEnv *jniEnv = JNIGetJNIEnv(); static jmethodID jmId = JNIUtilGetStaticMethodID(jniEnv, this->jclsOwner, zfTextA("native_nativeTimerCreate"), JNIGetMethodSig(JNIType::S_object(ZFImpl_sys_Android_JNI_NAME_Object), JNIParamTypeContainer() ).c_str()); jobject tmp = JNIUtilCallStaticObjectMethod(jniEnv, this->jclsOwner, jmId); jobject ret = JNIUtilNewGlobalRef(jniEnv, tmp); JNIUtilDeleteLocalRef(jniEnv, tmp); return ret; }
void ZFImpl_sys_Android_ZFUIMarginFromZFAndroidMargin(ZF_OUT ZFUIMargin &ret, ZF_IN jobject jobjMargin) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jclsMargin = ZFImpl_sys_Android_jclassZFAndroidMargin(); static jfieldID jfIdLeft = JNIUtilGetFieldID(jniEnv, jclsMargin, zfTextA("left"), JNIType::S_int.getId()); static jfieldID jfIdTop = JNIUtilGetFieldID(jniEnv, jclsMargin, zfTextA("top"), JNIType::S_int.getId()); static jfieldID jfIdRight = JNIUtilGetFieldID(jniEnv, jclsMargin, zfTextA("right"), JNIType::S_int.getId()); static jfieldID jfIdBottom = JNIUtilGetFieldID(jniEnv, jclsMargin, zfTextA("bottom"), JNIType::S_int.getId()); ret.left = JNIUtilGetIntField(jniEnv, jobjMargin, jfIdLeft); ret.top = JNIUtilGetIntField(jniEnv, jobjMargin, jfIdTop); ret.right = JNIUtilGetIntField(jniEnv, jobjMargin, jfIdRight); ret.bottom = JNIUtilGetIntField(jniEnv, jobjMargin, jfIdBottom); }
void ZFImpl_sys_Android_ZFUIRectFromZFAndroidRect(ZF_OUT ZFUIRect &ret, ZF_IN jobject jobjRect) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jclsRect = ZFImpl_sys_Android_jclassZFAndroidRect(); static jfieldID jfIdX = JNIUtilGetFieldID(jniEnv, jclsRect, zfTextA("x"), JNIType::S_int.getId()); static jfieldID jfIdY = JNIUtilGetFieldID(jniEnv, jclsRect, zfTextA("y"), JNIType::S_int.getId()); static jfieldID jfIdWidth = JNIUtilGetFieldID(jniEnv, jclsRect, zfTextA("width"), JNIType::S_int.getId()); static jfieldID jfIdHeight = JNIUtilGetFieldID(jniEnv, jclsRect, zfTextA("height"), JNIType::S_int.getId()); ret.point.x = JNIUtilGetIntField(jniEnv, jobjRect, jfIdX); ret.point.y = JNIUtilGetIntField(jniEnv, jobjRect, jfIdY); ret.size.width = JNIUtilGetIntField(jniEnv, jobjRect, jfIdWidth); ret.size.height = JNIUtilGetIntField(jniEnv, jobjRect, jfIdHeight); }
_ZFP_ZFObjectMutexImpl_sys_Android_MutexImpl(ZF_IN jclass jclsOwner) : ZFObjectMutexImpl() , jclsOwner(jclsOwner) , nativeMutex(NULL) { JNIEnv *jniEnv = JNIGetJNIEnv(); static jmethodID jmId = JNIUtilGetStaticMethodID(jniEnv, this->jclsOwner, zfTextA("native_nativeMutexCreate"), JNIGetMethodSig(JNIType::S_object(ZFImpl_sys_Android_JNI_NAME_Object), JNIParamTypeContainer() ).c_str()); jobject tmp = JNIUtilCallStaticObjectMethod(jniEnv, this->jclsOwner, jmId); this->nativeMutex = JNIUtilNewGlobalRef(jniEnv, tmp); JNIUtilDeleteLocalRef(jniEnv, tmp); }
zfstring &ZFImpl_sys_Android_zfstringFromString(ZF_IN_OUT zfstring &s, ZF_IN jobject jstr) { ZFSTRINGENCODING_SENSITIVE("use UTF8") JNIEnv *jniEnv = JNIGetJNIEnv(); jstring nativeString = ZFCastStatic(jstring, jstr); const zfcharA *utf8 = JNIUtilGetStringUTFChars(jniEnv, nativeString, zfnull); if(utf8 != zfnull) { s += utf8; } JNIUtilReleaseStringUTFChars(jniEnv, nativeString, utf8); return s; }
jobject ZFImpl_sys_Android_ZFUIMarginToZFAndroidMargin(ZF_IN const ZFUIMargin &margin, ZF_IN_OUT jobject jobjMargin) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jclsMargin = ZFImpl_sys_Android_jclassZFAndroidMargin(); static jfieldID jfIdLeft = JNIUtilGetFieldID(jniEnv, jclsMargin, zfTextA("left"), JNIType::S_int.getId()); static jfieldID jfIdTop = JNIUtilGetFieldID(jniEnv, jclsMargin, zfTextA("top"), JNIType::S_int.getId()); static jfieldID jfIdRight = JNIUtilGetFieldID(jniEnv, jclsMargin, zfTextA("right"), JNIType::S_int.getId()); static jfieldID jfIdBottom = JNIUtilGetFieldID(jniEnv, jclsMargin, zfTextA("bottom"), JNIType::S_int.getId()); JNIUtilSetIntField(jniEnv, jobjMargin, jfIdLeft, margin.left); JNIUtilSetIntField(jniEnv, jobjMargin, jfIdTop, margin.top); JNIUtilSetIntField(jniEnv, jobjMargin, jfIdRight, margin.right); JNIUtilSetIntField(jniEnv, jobjMargin, jfIdBottom, margin.bottom); return jobjMargin; }
zfstring ZFImpl_sys_Android_objectInfo(ZF_IN jobject nativeObject) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jcls = JNIUtilFindClass(jniEnv, JNIConvertClassNameForFindClass(ZFImpl_sys_Android_JNI_NAME_ZFAndroidLog).c_str()); static jmethodID jmId = JNIUtilGetStaticMethodID(jniEnv, jcls, zfTextA("objectInfo"), JNIGetMethodSig(JNIType::S_object(ZFImpl_sys_Android_JNI_NAME_String), JNIParamTypeContainer() .add(JNIType::S_object(ZFImpl_sys_Android_JNI_NAME_Object)) ).c_str()); jstring tmp = ZFCastStatic(jstring, JNIUtilCallStaticObjectMethod(jniEnv, jcls, jmId, nativeObject)); const char *utf = JNIUtilGetStringUTFChars(jniEnv, tmp, zfnull); zfstring ret = utf; JNIUtilReleaseStringUTFChars(jniEnv, tmp, utf); return ret; }
ZFUIRect ZFImpl_sys_Android_ZFUIRectFromZFAndroidRect(ZF_IN jobject jobjRect) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jclsRect = ZFImpl_sys_Android_jclassZFAndroidRect(); static jfieldID jfIdX = JNIUtilGetFieldID(jniEnv, jclsRect, zfTextA("x"), JNIType::S_int.getId()); static jfieldID jfIdY = JNIUtilGetFieldID(jniEnv, jclsRect, zfTextA("y"), JNIType::S_int.getId()); static jfieldID jfIdWidth = JNIUtilGetFieldID(jniEnv, jclsRect, zfTextA("width"), JNIType::S_int.getId()); static jfieldID jfIdHeight = JNIUtilGetFieldID(jniEnv, jclsRect, zfTextA("height"), JNIType::S_int.getId()); return ZFUIRectMake( JNIUtilGetIntField(jniEnv, jobjRect, jfIdX), JNIUtilGetIntField(jniEnv, jobjRect, jfIdY), JNIUtilGetIntField(jniEnv, jobjRect, jfIdWidth), JNIUtilGetIntField(jniEnv, jobjRect, jfIdHeight)); }
jobject ZFImpl_sys_Android_ZFUIRectToZFAndroidRect(ZF_IN const ZFUIRect &rect, ZF_IN_OUT jobject jobjRect) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jclsRect = ZFImpl_sys_Android_jclassZFAndroidRect(); static jfieldID jfIdX = JNIUtilGetFieldID(jniEnv, jclsRect, zfTextA("x"), JNIType::S_int.getId()); static jfieldID jfIdY = JNIUtilGetFieldID(jniEnv, jclsRect, zfTextA("y"), JNIType::S_int.getId()); static jfieldID jfIdWidth = JNIUtilGetFieldID(jniEnv, jclsRect, zfTextA("width"), JNIType::S_int.getId()); static jfieldID jfIdHeight = JNIUtilGetFieldID(jniEnv, jclsRect, zfTextA("height"), JNIType::S_int.getId()); JNIUtilSetIntField(jniEnv, jobjRect, jfIdX, rect.point.x); JNIUtilSetIntField(jniEnv, jobjRect, jfIdY, rect.point.y); JNIUtilSetIntField(jniEnv, jobjRect, jfIdWidth, rect.size.width); JNIUtilSetIntField(jniEnv, jobjRect, jfIdHeight, rect.size.height); return jobjRect; }
ZF_NAMESPACE_GLOBAL_BEGIN ZF_GLOBAL_INITIALIZER_INIT_WITH_LEVEL(ZFImpl_sys_Android_jclsHolder, ZFLevelZFFrameworkNormal) { jobject tmp = zfnull; JNIEnv *jniEnv = JNIGetJNIEnv(); tmp = JNIUtilFindClass(jniEnv, JNIConvertClassNameForFindClass(ZFImpl_sys_Android_JNI_NAME_Object).c_str()); this->jclsObject = (jclass)JNIUtilNewGlobalRef(jniEnv, tmp); JNIUtilDeleteLocalRef(jniEnv, tmp); tmp = JNIUtilFindClass(jniEnv, JNIConvertClassNameForFindClass(ZFImpl_sys_Android_JNI_NAME_String).c_str()); this->jclsString = (jclass)JNIUtilNewGlobalRef(jniEnv, tmp); JNIUtilDeleteLocalRef(jniEnv, tmp); }
zfstring ZFImpl_sys_Android_stackTrace(void) { JNIEnv *jniEnv = JNIGetJNIEnv(); jclass jcls = JNIUtilFindClass(jniEnv, JNIConvertClassNameForFindClass(ZFImpl_sys_Android_JNI_NAME_ZFAndroidLog).c_str()); static jmethodID jmId = JNIUtilGetStaticMethodID(jniEnv, jcls, zfTextA("stackTrace"), JNIGetMethodSig(JNIType::S_object(ZFImpl_sys_Android_JNI_NAME_String), JNIParamTypeContainer() ).c_str()); jstring jobjString = ZFCastStatic(jstring, JNIUtilCallStaticObjectMethod(jniEnv, jcls, jmId)); const char *utf = JNIUtilGetStringUTFChars(jniEnv, jobjString, zfnull); zfstring ret; if(utf != zfnull) { ret = utf; } JNIUtilReleaseStringUTFChars(jniEnv, jobjString, utf); return ret; }
virtual void timerStart(ZF_IN ZFTimer *timer) { JNIEnv *jniEnv = JNIGetJNIEnv(); static jmethodID jmId = JNIUtilGetStaticMethodID(jniEnv, this->jclsOwner, zfTextA("native_timerStart"), JNIGetMethodSig(JNIType::S_void, JNIParamTypeContainer() .add(JNIType::S_object(ZFImpl_sys_Android_JNI_NAME_Object)) .add(JNIPointerJNIType) .add(JNIType::S_long) .add(JNIType::S_long) .add(JNIType::S_boolean) ).c_str()); JNIUtilCallStaticVoidMethod(jniEnv, this->jclsOwner, jmId, ZFCastStatic(jobject, timer->nativeTimer()), JNIConvertZFObjectToJNIType(jniEnv, timer), timer->timerDelay(), timer->timerInterval(), timer->timerActivateInMainThread()); }
ZF_NAMESPACE_GLOBAL_BEGIN ZF_GLOBAL_INITIALIZER_INIT_WITH_LEVEL(ZFImpl_sys_Android_ZFUIKit_jclsHolder, ZFLevelZFFrameworkHigh) { jobject tmp = zfnull; JNIEnv *jniEnv = JNIGetJNIEnv(); tmp = JNIUtilFindClass(jniEnv, JNIConvertClassNameForFindClass(ZFImpl_sys_Android_JNI_NAME_ZFAndroidPoint).c_str()); this->jclsPoint = (jclass)JNIUtilNewGlobalRef(jniEnv, tmp); JNIUtilDeleteLocalRef(jniEnv, tmp); tmp = JNIUtilFindClass(jniEnv, JNIConvertClassNameForFindClass(ZFImpl_sys_Android_JNI_NAME_ZFAndroidSize).c_str()); this->jclsSize = (jclass)JNIUtilNewGlobalRef(jniEnv, tmp); JNIUtilDeleteLocalRef(jniEnv, tmp); tmp = JNIUtilFindClass(jniEnv, JNIConvertClassNameForFindClass(ZFImpl_sys_Android_JNI_NAME_ZFAndroidMargin).c_str()); this->jclsMargin = (jclass)JNIUtilNewGlobalRef(jniEnv, tmp); JNIUtilDeleteLocalRef(jniEnv, tmp); tmp = JNIUtilFindClass(jniEnv, JNIConvertClassNameForFindClass(ZFImpl_sys_Android_JNI_NAME_ZFAndroidRect).c_str()); this->jclsRect = (jclass)JNIUtilNewGlobalRef(jniEnv, tmp); JNIUtilDeleteLocalRef(jniEnv, tmp); }
virtual ~ZFPROTOCOL_IMPLEMENTATION_CLASS(ZFUIWebViewImpl_sys_Android)(void) { JNIEnv *jniEnv = JNIGetJNIEnv(); JNIUtilDeleteGlobalRef(jniEnv, this->jclsOwner); }
virtual ~_ZFP_ZFObjectMutexImpl_sys_Android_MutexImpl(void) { JNIEnv *jniEnv = JNIGetJNIEnv(); JNIUtilDeleteGlobalRef(jniEnv, this->nativeMutex); }