Mercurial > dwindows
comparison android/dw.cpp @ 2785:220d63da2183
Android: Implement ITEM_CONTEXT, ITEM_SELECT and TREE_EXPAND callbacks.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 10 Jul 2022 09:53:19 +0000 |
parents | 7d7eac751f7d |
children | 20d39af27aa4 |
comparison
equal
deleted
inserted
replaced
2784:cccbb367bcd3 | 2785:220d63da2183 |
---|---|
608 char *utf82 = str2 ? strdup(env->GetStringUTFChars(str2, nullptr)) : nullptr; | 608 char *utf82 = str2 ? strdup(env->GetStringUTFChars(str2, nullptr)) : nullptr; |
609 #else | 609 #else |
610 const char *utf81 = str1 ? env->GetStringUTFChars(str1, nullptr) : nullptr; | 610 const char *utf81 = str1 ? env->GetStringUTFChars(str1, nullptr) : nullptr; |
611 const char *utf82 = str2 ? env->GetStringUTFChars(str2, nullptr) : nullptr; | 611 const char *utf82 = str2 ? env->GetStringUTFChars(str2, nullptr) : nullptr; |
612 #endif | 612 #endif |
613 void *params[_DW_EVENT_PARAM_SIZE] = { (void *)obj2, (void *)utf81, (void *)utf82, | 613 void *params[_DW_EVENT_PARAM_SIZE] = { DW_POINTER(obj2), DW_POINTER(utf81), DW_POINTER(utf82), |
614 DW_INT_TO_POINTER(inta), DW_INT_TO_POINTER(intb), | 614 DW_INT_TO_POINTER(inta), DW_INT_TO_POINTER(intb), |
615 DW_INT_TO_POINTER(intc), DW_INT_TO_POINTER(intd), nullptr, | 615 DW_INT_TO_POINTER(intc), DW_INT_TO_POINTER(intd), nullptr, |
616 DW_INT_TO_POINTER(message), nullptr }; | 616 DW_INT_TO_POINTER(message), nullptr }; |
617 | 617 |
618 return _dw_event_handler(obj1, params); | 618 return _dw_event_handler(obj1, params); |
619 } | 619 } |
620 | 620 |
621 /* A more simple method for quicker calls */ | 621 /* A more simple method for quicker calls */ |
773 char *title = jtitle ? strdup(env->GetStringUTFChars(jtitle, nullptr)) : nullptr; | 773 char *title = jtitle ? strdup(env->GetStringUTFChars(jtitle, nullptr)) : nullptr; |
774 #else | 774 #else |
775 const char *title = jtitle ? env->GetStringUTFChars(jtitle, nullptr) : nullptr; | 775 const char *title = jtitle ? env->GetStringUTFChars(jtitle, nullptr) : nullptr; |
776 #endif | 776 #endif |
777 void *params[_DW_EVENT_PARAM_SIZE] = { nullptr, DW_POINTER(title), nullptr, DW_INT_TO_POINTER(x), DW_INT_TO_POINTER(y), | 777 void *params[_DW_EVENT_PARAM_SIZE] = { nullptr, DW_POINTER(title), nullptr, DW_INT_TO_POINTER(x), DW_INT_TO_POINTER(y), |
778 nullptr, nullptr, (void *)data, DW_INT_TO_POINTER(message), nullptr }; | 778 nullptr, nullptr, DW_POINTER(data), DW_INT_TO_POINTER(message), nullptr }; |
779 | |
780 _dw_event_handler(obj1, params); | |
781 } | |
782 | |
783 JNIEXPORT void JNICALL | |
784 Java_org_dbsoft_dwindows_DWindows_eventHandlerTree(JNIEnv* env, jobject obj, jobject obj1, | |
785 jint message, jobject item, jstring jtitle, jlong data) { | |
786 #ifdef _DW_EVENT_THREADING | |
787 char *title = jtitle ? strdup(env->GetStringUTFChars(jtitle, nullptr)) : nullptr; | |
788 #else | |
789 const char *title = jtitle ? env->GetStringUTFChars(jtitle, nullptr) : nullptr; | |
790 #endif | |
791 void *params[_DW_EVENT_PARAM_SIZE] = { DW_POINTER(item), DW_POINTER(title), nullptr, nullptr, nullptr, | |
792 nullptr, nullptr, DW_POINTER(data), DW_INT_TO_POINTER(message), nullptr }; | |
793 | |
794 _dw_event_handler(obj1, params); | |
795 } | |
796 | |
797 JNIEXPORT void JNICALL | |
798 Java_org_dbsoft_dwindows_DWindows_eventHandlerTreeItem(JNIEnv* env, jobject obj, jobject obj1, | |
799 jint message, jobject item) { | |
800 void *params[_DW_EVENT_PARAM_SIZE] = { DW_POINTER(item), nullptr, nullptr, nullptr, nullptr, | |
801 nullptr, nullptr, nullptr, DW_INT_TO_POINTER(message), nullptr }; | |
779 | 802 |
780 _dw_event_handler(obj1, params); | 803 _dw_event_handler(obj1, params); |
781 } | 804 } |
782 | 805 |
783 JNIEXPORT void JNICALL | 806 JNIEXPORT void JNICALL |