diff dw.h @ 2790:20d39af27aa4

Android: Add a new function for Android dw_file_open() which will open the URI that dw_file_browse() now saves at the end of the returned path. This is a hacky method of letting things function on Android... since Android seems to not let you open files with a pure path. Even if the file exists it will fail to open, you need to use the ugly Android URIs. Not sure if I will keep this solution or not, but committing it so Dynamic Windows Interface Builder will function on Android in the meantime. dw_file_open() just calls the system open() on non-Android platforms.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 13 Jul 2022 14:57:38 +0000
parents 9a3024fe719c
children 5c61aba17b69
line wrap: on
line diff
--- a/dw.h	Wed Jul 13 08:26:49 2022 +0000
+++ b/dw.h	Wed Jul 13 14:57:38 2022 +0000
@@ -2163,6 +2163,11 @@
 void API dw_environment_query(DWEnv *env);
 int API dw_exec(const char *program, int type, char **params);
 int API dw_browse(const char *url);
+#if defined(__ANDROID__)
+int API dw_file_open(const char *path, int mode);
+#else
+#define dw_file_open(a, b) open(a, b)
+#endif
 char * API dw_file_browse(const char *title, const char *defpath, const char *ext, int flags);
 char * API dw_user_dir(void);
 char * API dw_app_dir(void);