src/core/android/SDL_android.c
changeset 12024 3688283680b1
parent 12012 6de756c9975a
child 12059 320b43d5e5a7
equal deleted inserted replaced
12023:842dd960769e 12024:3688283680b1
   213 static jmethodID midSetWindowStyle;
   213 static jmethodID midSetWindowStyle;
   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 midInputGetInputDeviceIds;
   219 static jmethodID midInputGetInputDeviceIds;
   219 static jmethodID midSendMessage;
   220 static jmethodID midSendMessage;
   220 static jmethodID midShowTextInput;
   221 static jmethodID midShowTextInput;
   221 static jmethodID midIsScreenKeyboardShown;
   222 static jmethodID midIsScreenKeyboardShown;
   222 static jmethodID midClipboardSetText;
   223 static jmethodID midClipboardSetText;
   318                                 "getContext","()Landroid/content/Context;");
   319                                 "getContext","()Landroid/content/Context;");
   319     midIsAndroidTV = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   320     midIsAndroidTV = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   320                                 "isAndroidTV","()Z");
   321                                 "isAndroidTV","()Z");
   321     midIsChromebook = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   322     midIsChromebook = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   322                                 "isChromebook", "()Z");
   323                                 "isChromebook", "()Z");
       
   324     midIsDeXMode = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
       
   325                                 "isDeXMode", "()Z");
   323     midInputGetInputDeviceIds = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   326     midInputGetInputDeviceIds = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   324                                 "inputGetInputDeviceIds", "(I)[I");
   327                                 "inputGetInputDeviceIds", "(I)[I");
   325     midSendMessage = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   328     midSendMessage = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   326                                 "sendMessage", "(II)Z");
   329                                 "sendMessage", "(II)Z");
   327     midShowTextInput =  (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   330     midShowTextInput =  (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   352        !midSetActivityTitle || !midSetWindowStyle || !midSetOrientation || !midGetContext || !midIsAndroidTV || !midInputGetInputDeviceIds ||
   355        !midSetActivityTitle || !midSetWindowStyle || !midSetOrientation || !midGetContext || !midIsAndroidTV || !midInputGetInputDeviceIds ||
   353        !midSendMessage || !midShowTextInput || !midIsScreenKeyboardShown ||
   356        !midSendMessage || !midShowTextInput || !midIsScreenKeyboardShown ||
   354        !midClipboardSetText || !midClipboardGetText || !midClipboardHasText ||
   357        !midClipboardSetText || !midClipboardGetText || !midClipboardHasText ||
   355        !midOpenAPKExpansionInputStream || !midGetManifestEnvironmentVariables || !midGetDisplayDPI ||
   358        !midOpenAPKExpansionInputStream || !midGetManifestEnvironmentVariables || !midGetDisplayDPI ||
   356        !midCreateCustomCursor || !midSetCustomCursor || !midSetSystemCursor || !midSupportsRelativeMouse || !midSetRelativeMouseEnabled ||
   359        !midCreateCustomCursor || !midSetCustomCursor || !midSetSystemCursor || !midSupportsRelativeMouse || !midSetRelativeMouseEnabled ||
   357        !midIsChromebook) {
   360        !midIsChromebook || !midIsDeXMode) {
   358         __android_log_print(ANDROID_LOG_WARN, "SDL", "Missing some Java callbacks, do you have the latest version of SDLActivity.java?");
   361         __android_log_print(ANDROID_LOG_WARN, "SDL", "Missing some Java callbacks, do you have the latest version of SDLActivity.java?");
   359     }
   362     }
   360 
   363 
   361     fidSeparateMouseAndTouch = (*mEnv)->GetStaticFieldID(mEnv, mActivityClass, "mSeparateMouseAndTouch", "Z");
   364     fidSeparateMouseAndTouch = (*mEnv)->GetStaticFieldID(mEnv, mActivityClass, "mSeparateMouseAndTouch", "Z");
   362 
   365 
  2034 {
  2037 {
  2035     JNIEnv *env = Android_JNI_GetEnv();
  2038     JNIEnv *env = Android_JNI_GetEnv();
  2036     return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsChromebook);
  2039     return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsChromebook);
  2037 }
  2040 }
  2038 
  2041 
       
  2042 SDL_bool SDL_IsDeXMode(void)
       
  2043 {
       
  2044     JNIEnv *env = Android_JNI_GetEnv();
       
  2045     return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsDeXMode);
       
  2046 }
       
  2047 
  2039 const char * SDL_AndroidGetInternalStoragePath(void)
  2048 const char * SDL_AndroidGetInternalStoragePath(void)
  2040 {
  2049 {
  2041     static char *s_AndroidInternalFilesPath = NULL;
  2050     static char *s_AndroidInternalFilesPath = NULL;
  2042 
  2051 
  2043     if (!s_AndroidInternalFilesPath) {
  2052     if (!s_AndroidInternalFilesPath) {