src/core/android/SDL_android.c
changeset 12008 91f9b8f22b17
parent 12007 ecfb6a793c30
child 12012 6de756c9975a
equal deleted inserted replaced
12007:ecfb6a793c30 12008:91f9b8f22b17
   211 static jmethodID midSetActivityTitle;
   211 static jmethodID midSetActivityTitle;
   212 static jmethodID midSetWindowStyle;
   212 static jmethodID midSetWindowStyle;
   213 static jmethodID midSetOrientation;
   213 static jmethodID midSetOrientation;
   214 static jmethodID midGetContext;
   214 static jmethodID midGetContext;
   215 static jmethodID midIsAndroidTV;
   215 static jmethodID midIsAndroidTV;
       
   216 static jmethodID midIsChromebook;
   216 static jmethodID midInputGetInputDeviceIds;
   217 static jmethodID midInputGetInputDeviceIds;
   217 static jmethodID midSendMessage;
   218 static jmethodID midSendMessage;
   218 static jmethodID midShowTextInput;
   219 static jmethodID midShowTextInput;
   219 static jmethodID midIsScreenKeyboardShown;
   220 static jmethodID midIsScreenKeyboardShown;
   220 static jmethodID midClipboardSetText;
   221 static jmethodID midClipboardSetText;
   314                                 "setOrientation","(IIZLjava/lang/String;)V");
   315                                 "setOrientation","(IIZLjava/lang/String;)V");
   315     midGetContext = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   316     midGetContext = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   316                                 "getContext","()Landroid/content/Context;");
   317                                 "getContext","()Landroid/content/Context;");
   317     midIsAndroidTV = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   318     midIsAndroidTV = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   318                                 "isAndroidTV","()Z");
   319                                 "isAndroidTV","()Z");
       
   320     midIsChromebook = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
       
   321                                 "isChromebook", "()Z");
   319     midInputGetInputDeviceIds = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   322     midInputGetInputDeviceIds = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   320                                 "inputGetInputDeviceIds", "(I)[I");
   323                                 "inputGetInputDeviceIds", "(I)[I");
   321     midSendMessage = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   324     midSendMessage = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   322                                 "sendMessage", "(II)Z");
   325                                 "sendMessage", "(II)Z");
   323     midShowTextInput =  (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   326     midShowTextInput =  (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
   347     if (!midGetNativeSurface ||
   350     if (!midGetNativeSurface ||
   348        !midSetActivityTitle || !midSetWindowStyle || !midSetOrientation || !midGetContext || !midIsAndroidTV || !midInputGetInputDeviceIds ||
   351        !midSetActivityTitle || !midSetWindowStyle || !midSetOrientation || !midGetContext || !midIsAndroidTV || !midInputGetInputDeviceIds ||
   349        !midSendMessage || !midShowTextInput || !midIsScreenKeyboardShown ||
   352        !midSendMessage || !midShowTextInput || !midIsScreenKeyboardShown ||
   350        !midClipboardSetText || !midClipboardGetText || !midClipboardHasText ||
   353        !midClipboardSetText || !midClipboardGetText || !midClipboardHasText ||
   351        !midOpenAPKExpansionInputStream || !midGetManifestEnvironmentVariables || !midGetDisplayDPI ||
   354        !midOpenAPKExpansionInputStream || !midGetManifestEnvironmentVariables || !midGetDisplayDPI ||
   352        !midCreateCustomCursor || !midSetCustomCursor || !midSetSystemCursor || !midSupportsRelativeMouse || !midSetRelativeMouseEnabled) {
   355        !midCreateCustomCursor || !midSetCustomCursor || !midSetSystemCursor || !midSupportsRelativeMouse || !midSetRelativeMouseEnabled ||
       
   356        !midIsChromebook) {
   353         __android_log_print(ANDROID_LOG_WARN, "SDL", "Missing some Java callbacks, do you have the latest version of SDLActivity.java?");
   357         __android_log_print(ANDROID_LOG_WARN, "SDL", "Missing some Java callbacks, do you have the latest version of SDLActivity.java?");
   354     }
   358     }
   355 
   359 
   356     fidSeparateMouseAndTouch = (*mEnv)->GetStaticFieldID(mEnv, mActivityClass, "mSeparateMouseAndTouch", "Z");
   360     fidSeparateMouseAndTouch = (*mEnv)->GetStaticFieldID(mEnv, mActivityClass, "mSeparateMouseAndTouch", "Z");
   357 
   361 
  2022 {
  2026 {
  2023     JNIEnv *env = Android_JNI_GetEnv();
  2027     JNIEnv *env = Android_JNI_GetEnv();
  2024     return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsAndroidTV);
  2028     return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsAndroidTV);
  2025 }
  2029 }
  2026 
  2030 
       
  2031 SDL_bool SDL_IsChromebook(void)
       
  2032 {
       
  2033     JNIEnv *env = Android_JNI_GetEnv();
       
  2034     return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsChromebook);
       
  2035 }
       
  2036 
  2027 const char * SDL_AndroidGetInternalStoragePath(void)
  2037 const char * SDL_AndroidGetInternalStoragePath(void)
  2028 {
  2038 {
  2029     static char *s_AndroidInternalFilesPath = NULL;
  2039     static char *s_AndroidInternalFilesPath = NULL;
  2030 
  2040 
  2031     if (!s_AndroidInternalFilesPath) {
  2041     if (!s_AndroidInternalFilesPath) {