| 388 | static FileDialogCallback ofd_callback; |
| 389 | static int ofd_action; |
| 390 | static void JNICALL java_processOFDResult(JNIEnv* env, jobject o, jstring str) { |
| 391 | const char* raw; |
| 392 | char buffer[NATIVE_STR_LEN]; cc_string path; |
| 393 | String_InitArray(path, buffer); |
| 394 | |
| 395 | // TODO should be raw |
| 396 | Java_DecodeString(env, str, &path); |
| 397 | ofd_callback(&path); |
| 398 | |
| 399 | if (ofd_action == OFD_UPLOAD_DELETE) { |
| 400 | // TODO better way of doing this? msybe move to java side? |
| 401 | raw = (*env)->GetStringUTFChars(env, str, NULL); |
| 402 | unlink(raw); |
| 403 | (*env)->ReleaseStringUTFChars(env, str, raw); |
| 404 | } |
| 405 | ofd_callback = NULL; |
| 406 | } |
| 407 | |
| 408 | cc_result Window_OpenFileDialog(const struct OpenFileDialogArgs* open_args) { |
| 409 | JNIEnv* env; |
nothing calls this directly
no test coverage detected