src/core/android/SDL_android.c
changeset 12059 320b43d5e5a7
parent 12024 3688283680b1
child 12127 f92fd2c57780
equal deleted inserted replaced
12058:1a1133e9c7d4 12059:320b43d5e5a7
   214 static jmethodID midSetOrientation;
   214 static jmethodID midSetOrientation;
   215 static jmethodID midGetContext;
   215 static jmethodID midGetContext;
   216 static jmethodID midIsAndroidTV;
   216 static jmethodID midIsAndroidTV;
   217 static jmethodID midIsChromebook;
   217 static jmethodID midIsChromebook;
   218 static jmethodID midIsDeXMode;
   218 static jmethodID midIsDeXMode;
       
   219 static jmethodID midManualBackButton;
   219 static jmethodID midInputGetInputDeviceIds;
   220 static jmethodID midInputGetInputDeviceIds;
   220 static jmethodID midSendMessage;
   221 static jmethodID midSendMessage;
   221 static jmethodID midShowTextInput;
   222 static jmethodID midShowTextInput;
   222 static jmethodID midIsScreenKeyboardShown;
   223 static jmethodID midIsScreenKeyboardShown;
   223 static jmethodID midClipboardSetText;
   224 static jmethodID midClipboardSetText;
   321                                 "isAndroidTV","()Z");
   322                                 "isAndroidTV","()Z");
   322     midIsChromebook = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   323     midIsChromebook = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   323                                 "isChromebook", "()Z");
   324                                 "isChromebook", "()Z");
   324     midIsDeXMode = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   325     midIsDeXMode = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   325                                 "isDeXMode", "()Z");
   326                                 "isDeXMode", "()Z");
       
   327     midManualBackButton = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
       
   328                                 "manualBackButton", "()V");
   326     midInputGetInputDeviceIds = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   329     midInputGetInputDeviceIds = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   327                                 "inputGetInputDeviceIds", "(I)[I");
   330                                 "inputGetInputDeviceIds", "(I)[I");
   328     midSendMessage = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   331     midSendMessage = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   329                                 "sendMessage", "(II)Z");
   332                                 "sendMessage", "(II)Z");
   330     midShowTextInput =  (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   333     midShowTextInput =  (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   355        !midSetActivityTitle || !midSetWindowStyle || !midSetOrientation || !midGetContext || !midIsAndroidTV || !midInputGetInputDeviceIds ||
   358        !midSetActivityTitle || !midSetWindowStyle || !midSetOrientation || !midGetContext || !midIsAndroidTV || !midInputGetInputDeviceIds ||
   356        !midSendMessage || !midShowTextInput || !midIsScreenKeyboardShown ||
   359        !midSendMessage || !midShowTextInput || !midIsScreenKeyboardShown ||
   357        !midClipboardSetText || !midClipboardGetText || !midClipboardHasText ||
   360        !midClipboardSetText || !midClipboardGetText || !midClipboardHasText ||
   358        !midOpenAPKExpansionInputStream || !midGetManifestEnvironmentVariables || !midGetDisplayDPI ||
   361        !midOpenAPKExpansionInputStream || !midGetManifestEnvironmentVariables || !midGetDisplayDPI ||
   359        !midCreateCustomCursor || !midSetCustomCursor || !midSetSystemCursor || !midSupportsRelativeMouse || !midSetRelativeMouseEnabled ||
   362        !midCreateCustomCursor || !midSetCustomCursor || !midSetSystemCursor || !midSupportsRelativeMouse || !midSetRelativeMouseEnabled ||
   360        !midIsChromebook || !midIsDeXMode) {
   363        !midIsChromebook || !midIsDeXMode || !midManualBackButton) {
   361         __android_log_print(ANDROID_LOG_WARN, "SDL", "Missing some Java callbacks, do you have the latest version of SDLActivity.java?");
   364         __android_log_print(ANDROID_LOG_WARN, "SDL", "Missing some Java callbacks, do you have the latest version of SDLActivity.java?");
   362     }
   365     }
   363 
   366 
   364     fidSeparateMouseAndTouch = (*mEnv)->GetStaticFieldID(mEnv, mActivityClass, "mSeparateMouseAndTouch", "Z");
   367     fidSeparateMouseAndTouch = (*mEnv)->GetStaticFieldID(mEnv, mActivityClass, "mSeparateMouseAndTouch", "Z");
   365 
   368 
  2043 {
  2046 {
  2044     JNIEnv *env = Android_JNI_GetEnv();
  2047     JNIEnv *env = Android_JNI_GetEnv();
  2045     return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsDeXMode);
  2048     return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsDeXMode);
  2046 }
  2049 }
  2047 
  2050 
       
  2051 void SDL_AndroidBackButton(void)
       
  2052 {
       
  2053     JNIEnv *env = Android_JNI_GetEnv();
       
  2054     return (*env)->CallStaticVoidMethod(env, mActivityClass, midManualBackButton);
       
  2055 }
       
  2056 
  2048 const char * SDL_AndroidGetInternalStoragePath(void)
  2057 const char * SDL_AndroidGetInternalStoragePath(void)
  2049 {
  2058 {
  2050     static char *s_AndroidInternalFilesPath = NULL;
  2059     static char *s_AndroidInternalFilesPath = NULL;
  2051 
  2060 
  2052     if (!s_AndroidInternalFilesPath) {
  2061     if (!s_AndroidInternalFilesPath) {