X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fporting_android.h;h=6eb0540412ad159f8634264a89b06fbbc22972e8;hb=b504a1aa4bdc56676b4b1c398ebfe98d336f8f6e;hp=bfdadfbff02feb4b9fd22cd014f1fefe17e7e6a7;hpb=1cc40c0a7c260f0562572bc99f39a666a12f1b09;p=minetest.git diff --git a/src/porting_android.h b/src/porting_android.h index bfdadfbff..6eb054041 100644 --- a/src/porting_android.h +++ b/src/porting_android.h @@ -16,8 +16,8 @@ You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __PORTING_ANDROID_H__ -#define __PORTING_ANDROID_H__ + +#pragma once #ifndef __ANDROID__ #error this include has to be included on android port only! @@ -30,28 +30,22 @@ with this program; if not, write to the Free Software Foundation, Inc., #include namespace porting { -/** java app **/ +// java app extern android_app *app_global; -/** java <-> c++ interaction interface **/ +// java <-> c++ interaction interface extern JNIEnv *jnienv; -/** - * do initialization required on android only - */ +// do initialization required on android only void initAndroid(); -void cleanupAndroid(); -/** - * set storage dir on external sdcard# - * @param lJNIEnv environment from android - */ -void setExternalStorageDir(JNIEnv* lJNIEnv); +void cleanupAndroid(); /** - * use java function to copy media from assets to external storage + * Initializes path_* variables for Android + * @param env Android JNI environment */ -void copyAssets(); +void initializePathsAndroid(); /** * show text input dialog in java @@ -61,8 +55,10 @@ void copyAssets(); * @param editType type of texfield * (1==multiline text input; 2==single line text input; 3=password field) */ -void showInputDialog(const std::string& acceptButton, - const std::string& hint, const std::string& current, int editType); +void showInputDialog(const std::string &acceptButton, + const std::string &hint, const std::string ¤t, int editType); + +void openURLAndroid(const std::string &url); /** * WORKAROUND for not working callbacks from java -> c++ @@ -76,6 +72,8 @@ int getInputDialogState(); */ std::string getInputDialogValue(); -} - +#ifndef SERVER +float getDisplayDensity(); +v2u32 getDisplaySize(); #endif +}