comparison android/dw.cpp @ 2548:c4d75d30430c

Android: Minor fixes to that last commit... missed dw.h changes and remove test code.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 14 May 2021 11:41:31 +0000
parents dbd15c13f5bb
children 127779860ac1
comparison
equal deleted inserted replaced
2547:dbd15c13f5bb 2548:c4d75d30430c
2597 if((handle || pixmap) && text && (width || height) && (env = (JNIEnv *)pthread_getspecific(_dw_env_key))) 2597 if((handle || pixmap) && text && (width || height) && (env = (JNIEnv *)pthread_getspecific(_dw_env_key)))
2598 { 2598 {
2599 // Construct the string 2599 // Construct the string
2600 jstring jstr = env->NewStringUTF(text); 2600 jstring jstr = env->NewStringUTF(text);
2601 // First get the class that contains the method you need to call 2601 // First get the class that contains the method you need to call
2602 //jclass clazz = _dw_find_class(env, DW_CLASS_NAME); 2602 jclass clazz = _dw_find_class(env, DW_CLASS_NAME);
2603 jclass clazz = env->FindClass(DW_CLASS_NAME);
2604 // Get the method that you want to call 2603 // Get the method that you want to call
2605 jmethodID fontTextExtentsGet = env->GetMethodID(clazz, "fontTextExtentsGet", 2604 jmethodID fontTextExtentsGet = env->GetMethodID(clazz, "fontTextExtentsGet",
2606 "(Lorg/dbsoft/dwindows/DWRender;Landroid/graphics/Bitmap;Ljava/lang/String;Landroid/graphics/Typeface;ILandroid/view/View;)J"); 2605 "(Lorg/dbsoft/dwindows/DWRender;Landroid/graphics/Bitmap;Ljava/lang/String;Landroid/graphics/Typeface;ILandroid/view/View;)J");
2607 // Call the method on the object 2606 // Call the method on the object
2608 jlong dimensions = env->CallLongMethod(_dw_obj, fontTextExtentsGet, handle, pixmap ? pixmap->bitmap : nullptr, jstr, 2607 jlong dimensions = env->CallLongMethod(_dw_obj, fontTextExtentsGet, handle, pixmap ? pixmap->bitmap : nullptr, jstr,