comparison android/dw.cpp @ 2708:3a7dcc0ae08b

Android: Implement dw_mle_search(). Also revert lowercase() change. Another system is telling me lowercase() is experimental.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 19 Nov 2021 18:48:41 +0000
parents a3f6ca621453
children 3cb5aa73dace
comparison
equal deleted inserted replaced
2707:a3f6ca621453 2708:3a7dcc0ae08b
2801 * Returns: 2801 * Returns:
2802 * Position in buffer or DW_ERROR_UNKNOWN (-1) on error. 2802 * Position in buffer or DW_ERROR_UNKNOWN (-1) on error.
2803 */ 2803 */
2804 int API dw_mle_search(HWND handle, const char *text, int point, unsigned long flags) 2804 int API dw_mle_search(HWND handle, const char *text, int point, unsigned long flags)
2805 { 2805 {
2806 return DW_ERROR_UNKNOWN; 2806 JNIEnv *env;
2807 int retval = DW_ERROR_UNKNOWN;
2808
2809 if((env = (JNIEnv *)pthread_getspecific(_dw_env_key)))
2810 {
2811 // Construct a String
2812 jstring jstr = env->NewStringUTF(text);
2813 // First get the class that contains the method you need to call
2814 jclass clazz = _dw_find_class(env, DW_CLASS_NAME);
2815 // Get the method that you want to call
2816 jmethodID mleSearch = env->GetMethodID(clazz, "mleSearch",
2817 "(Landroid/widget/EditText;Ljava/lang/String;II)I");
2818 // Call the method on the object
2819 retval = env->CallIntMethod(_dw_obj, mleSearch, handle, jstr, point, (jint)flags);
2820 if(_dw_jni_check_exception(env))
2821 retval = DW_ERROR_UNKNOWN;
2822 }
2823 return retval;
2807 } 2824 }
2808 2825
2809 /* 2826 /*
2810 * Stops redrawing of an MLE box. 2827 * Stops redrawing of an MLE box.
2811 * Parameters: 2828 * Parameters: