diff android/dw.cpp @ 2499:ff3310fa6d72

Android: Implment DW_SIGNA_CONFIGURE on orientation change. Seems like my dream of having a single C entrypoint for events is dead, passing any NULL objects for unused parameters results in a sementation violation. Leaving the general purpose function in the code for now, but eventually it will go away.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 05 May 2021 19:53:33 +0000
parents 4ae2b3b77f25
children ac0b7e579229
line wrap: on
line diff
--- a/android/dw.cpp	Wed May 05 09:15:08 2021 +0000
+++ b/android/dw.cpp	Wed May 05 19:53:33 2021 +0000
@@ -353,12 +353,12 @@
 JNIEXPORT jint JNICALL
 Java_org_dbsoft_dwindows_DWindows_eventHandler(JNIEnv* env, jobject obj, jobject obj1, jobject obj2,
                                                       jint message, jstring str1, jstring str2,
-                                                      jint int1, jint int2, jint int3, jint int4) {
+                                                      jint inta, jint intb, jint intc, jint intd) {
     const char *utf81 = str1 ? env->GetStringUTFChars(str1, NULL) : NULL;
     const char *utf82 = str2 ? env->GetStringUTFChars(str2, NULL) : NULL;
     void *params[8] = { (void *)obj2, (void *)utf81, (void *)utf82,
-                        DW_INT_TO_POINTER(int1), DW_INT_TO_POINTER(int2),
-                        DW_INT_TO_POINTER(int3), DW_INT_TO_POINTER(int4), NULL };
+                        DW_INT_TO_POINTER(inta), DW_INT_TO_POINTER(intb),
+                        DW_INT_TO_POINTER(intc), DW_INT_TO_POINTER(intd), NULL };
 
     return _dw_event_handler(obj1, params, message);
 }
@@ -380,6 +380,16 @@
     _dw_event_handler(obj1, params, message);
 }
 
+JNIEXPORT void JNICALL
+Java_org_dbsoft_dwindows_DWindows_eventHandlerInt(JNIEnv* env, jobject obj, jobject obj1, jint message,
+                                               jint inta, jint intb, jint intc, jint intd) {
+    void *params[8] = { NULL, NULL, NULL,
+                        DW_INT_TO_POINTER(inta), DW_INT_TO_POINTER(intb),
+                        DW_INT_TO_POINTER(intc), DW_INT_TO_POINTER(intd), NULL };
+
+    _dw_event_handler(obj1, params, message);
+}
+
 /* Handler for Timer events */
 JNIEXPORT jint JNICALL
 Java_org_dbsoft_dwindows_DWindows_eventHandlerTimer(JNIEnv* env, jobject obj, jlong sigfunc, jlong data) {