SDL  2.0
org.libsdl.app.SDLActivity Class Reference
+ Inheritance diagram for org.libsdl.app.SDLActivity:
+ Collaboration diagram for org.libsdl.app.SDLActivity:

Data Structures

enum  NativeState
 
class  SDLCommandHandler
 
class  ShowTextInputTask
 

Public Member Functions

void loadLibraries ()
 
void onWindowFocusChanged (boolean hasFocus)
 
void onLowMemory ()
 
void onBackPressed ()
 
void pressBackButton ()
 
void superOnBackPressed ()
 
boolean dispatchKeyEvent (KeyEvent event)
 
void setOrientationBis (int w, int h, boolean resizable, String hint)
 
int messageboxShowMessageBox (final int flags, final String title, final String message, final int[] buttonFlags, final int[] buttonIds, final String[] buttonTexts, final int[] colors)
 
void onSystemUiVisibilityChange (int visibility)
 

Static Public Member Functions

static void initialize ()
 
static int getCurrentOrientation ()
 
static void manualBackButton ()
 
static void handleNativeState ()
 
static void handleNativeExit ()
 
static native int nativeSetupJNI ()
 
static native int nativeRunMain (String library, String function, Object arguments)
 
static native void nativeLowMemory ()
 
static native void nativeQuit ()
 
static native void nativePause ()
 
static native void nativeResume ()
 
static native void onNativeDropFile (String filename)
 
static native void onNativeResize (int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, int format, float rate)
 
static native void onNativeKeyDown (int keycode)
 
static native void onNativeKeyUp (int keycode)
 
static native void onNativeKeyboardFocusLost ()
 
static native void onNativeMouse (int button, int action, float x, float y, boolean relative)
 
static native void onNativeTouch (int touchDevId, int pointerFingerId, int action, float x, float y, float p)
 
static native void onNativeAccel (float x, float y, float z)
 
static native void onNativeClipboardChanged ()
 
static native void onNativeSurfaceChanged ()
 
static native void onNativeSurfaceDestroyed ()
 
static native String nativeGetHint (String name)
 
static native void nativeSetenv (String name, String value)
 
static native void onNativeOrientationChanged (int orientation)
 
static boolean setActivityTitle (String title)
 
static void setWindowStyle (boolean fullscreen)
 
static void setOrientation (int w, int h, boolean resizable, String hint)
 
static boolean isScreenKeyboardShown ()
 
static boolean supportsRelativeMouse ()
 
static boolean setRelativeMouseEnabled (boolean enabled)
 
static boolean sendMessage (int command, int param)
 
static Context getContext ()
 
static boolean isAndroidTV ()
 
static boolean isTablet ()
 
static boolean isChromebook ()
 
static boolean isDeXMode ()
 
static DisplayMetrics getDisplayDPI ()
 
static boolean getManifestEnvironmentVariables ()
 
static View getContentView ()
 
static boolean showTextInput (int x, int y, int w, int h)
 
static boolean isTextInputEvent (KeyEvent event)
 
static Surface getNativeSurface ()
 
static int [] inputGetInputDeviceIds (int sources)
 
static InputStream openAPKExpansionInputStream (String fileName) throws IOException
 
static boolean clipboardHasText ()
 
static String clipboardGetText ()
 
static void clipboardSetText (String string)
 
static int createCustomCursor (int[] colors, int width, int height, int hotSpotX, int hotSpotY)
 
static boolean setCustomCursor (int cursorID)
 
static boolean setSystemCursor (int cursorID)
 

Static Public Attributes

static boolean mIsResumedCalled
 
static NativeState mNextNativeState
 
static NativeState mCurrentNativeState
 
static boolean mExitCalledFromJava
 
static boolean mBrokenLibraries
 
static boolean mSeparateMouseAndTouch
 

Protected Member Functions

String getMainSharedObject ()
 
String getMainFunction ()
 
String [] getLibraries ()
 
String [] getArguments ()
 
void onCreate (Bundle savedInstanceState)
 
void onPause ()
 
void onResume ()
 
void onDestroy ()
 
boolean onUnhandledMessage (int command, Object param)
 
Dialog onCreateDialog (int ignore, Bundle args)
 

Static Protected Member Functions

static SDLGenericMotionListener_API12 getMotionListener ()
 

Protected Attributes

final int [] messageboxSelection = new int[1]
 
int dialogs = 0
 

Static Protected Attributes

static final int SDL_ORIENTATION_UNKNOWN = 0
 
static final int SDL_ORIENTATION_LANDSCAPE = 1
 
static final int SDL_ORIENTATION_LANDSCAPE_FLIPPED = 2
 
static final int SDL_ORIENTATION_PORTRAIT = 3
 
static final int SDL_ORIENTATION_PORTRAIT_FLIPPED = 4
 
static int mCurrentOrientation
 
static SDLActivity mSingleton
 
static SDLSurface mSurface
 
static View mTextEdit
 
static boolean mScreenKeyboardShown
 
static ViewGroup mLayout
 
static SDLClipboardHandler mClipboardHandler
 
static Hashtable< Integer, Object > mCursors
 
static int mLastCursorID
 
static SDLGenericMotionListener_API12 mMotionListener
 
static HIDDeviceManager mHIDDeviceManager
 
static Thread mSDLThread
 
static final int COMMAND_USER = 0x8000
 
static boolean mFullscreenModeActive
 

Private Attributes

final Runnable rehideSystemUi
 

Static Private Attributes

static final String TAG = "SDL"
 
static final int SDL_SYSTEM_CURSOR_NONE = -1
 
static final int SDL_SYSTEM_CURSOR_ARROW = 0
 
static final int SDL_SYSTEM_CURSOR_IBEAM = 1
 
static final int SDL_SYSTEM_CURSOR_WAIT = 2
 
static final int SDL_SYSTEM_CURSOR_CROSSHAIR = 3
 
static final int SDL_SYSTEM_CURSOR_WAITARROW = 4
 
static final int SDL_SYSTEM_CURSOR_SIZENWSE = 5
 
static final int SDL_SYSTEM_CURSOR_SIZENESW = 6
 
static final int SDL_SYSTEM_CURSOR_SIZEWE = 7
 
static final int SDL_SYSTEM_CURSOR_SIZENS = 8
 
static final int SDL_SYSTEM_CURSOR_SIZEALL = 9
 
static final int SDL_SYSTEM_CURSOR_NO = 10
 
static final int SDL_SYSTEM_CURSOR_HAND = 11
 
static Object expansionFile
 
static Method expansionFileMethod
 

Detailed Description

SDL Activity

Definition at line 37 of file SDLActivity.java.

Member Function Documentation

◆ clipboardGetText()

static String org.libsdl.app.SDLActivity.clipboardGetText ( )
inlinestatic

This method is called by SDL using JNI.

Definition at line 1365 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

1365  {
1366  return mClipboardHandler.clipboardGetText();
1367  }
static SDLClipboardHandler mClipboardHandler

◆ clipboardHasText()

static boolean org.libsdl.app.SDLActivity.clipboardHasText ( )
inlinestatic

This method is called by SDL using JNI.

Definition at line 1358 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

1358  {
1359  return mClipboardHandler.clipboardHasText();
1360  }
static SDLClipboardHandler mClipboardHandler

◆ clipboardSetText()

static void org.libsdl.app.SDLActivity.clipboardSetText ( String  string)
inlinestatic

This method is called by SDL using JNI.

Definition at line 1372 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

1372  {
1373  mClipboardHandler.clipboardSetText(string);
1374  }
static SDLClipboardHandler mClipboardHandler

◆ createCustomCursor()

static int org.libsdl.app.SDLActivity.createCustomCursor ( int []  colors,
int  width,
int  height,
int  hotSpotX,
int  hotSpotY 
)
inlinestatic

This method is called by SDL using JNI.

Definition at line 1379 of file SDLActivity.java.

References e, and org.libsdl.app.SDLActivity.mLastCursorID.

1379  {
1380  Bitmap bitmap = Bitmap.createBitmap(colors, width, height, Bitmap.Config.ARGB_8888);
1381  ++mLastCursorID;
1382  // This requires API 24, so use reflection to implement this
1383  try {
1384  Class PointerIconClass = Class.forName("android.view.PointerIcon");
1385  Class[] arg_types = new Class[] { Bitmap.class, float.class, float.class };
1386  Method create = PointerIconClass.getMethod("create", arg_types);
1387  mCursors.put(mLastCursorID, create.invoke(null, bitmap, hotSpotX, hotSpotY));
1388  } catch (Exception e) {
1389  return 0;
1390  }
1391  return mLastCursorID;
1392  }
GLsizei GLfixed GLfixed GLfixed GLfixed const GLubyte * bitmap
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 * e
static Hashtable< Integer, Object > mCursors
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1572
static int colors[7]
Definition: testgesture.c:39

◆ dispatchKeyEvent()

boolean org.libsdl.app.SDLActivity.dispatchKeyEvent ( KeyEvent  event)
inline

Definition at line 457 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.mBrokenLibraries.

457  {
458 
459  if (SDLActivity.mBrokenLibraries) {
460  return false;
461  }
462 
463  int keyCode = event.getKeyCode();
464  // Ignore certain special keys so they're handled by Android
465  if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN ||
466  keyCode == KeyEvent.KEYCODE_VOLUME_UP ||
467  keyCode == KeyEvent.KEYCODE_CAMERA ||
468  keyCode == KeyEvent.KEYCODE_ZOOM_IN || /* API 11 */
469  keyCode == KeyEvent.KEYCODE_ZOOM_OUT /* API 11 */
470  ) {
471  return false;
472  }
473  return super.dispatchKeyEvent(event);
474  }
struct _cl_event * event

◆ getArguments()

String [] org.libsdl.app.SDLActivity.getArguments ( )
inlineprotected

This method is called by SDL before starting the native application thread. It can be overridden to provide the arguments after the application name. The default implementation returns an empty array. It never returns null.

Returns
arguments for the native application.

Definition at line 167 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

167  {
168  return new String[0];
169  }

◆ getContentView()

static View org.libsdl.app.SDLActivity.getContentView ( )
inlinestatic

◆ getContext()

◆ getCurrentOrientation()

static int org.libsdl.app.SDLActivity.getCurrentOrientation ( )
inlinestatic

Definition at line 319 of file SDLActivity.java.

References context, org.libsdl.app.SDLActivity.getContext(), org.libsdl.app.SDLActivity.SDL_ORIENTATION_LANDSCAPE, org.libsdl.app.SDLActivity.SDL_ORIENTATION_LANDSCAPE_FLIPPED, org.libsdl.app.SDLActivity.SDL_ORIENTATION_PORTRAIT, org.libsdl.app.SDLActivity.SDL_ORIENTATION_PORTRAIT_FLIPPED, and org.libsdl.app.SDLActivity.SDL_ORIENTATION_UNKNOWN.

Referenced by org.libsdl.app.SDLActivity.onCreate().

319  {
320  final Context context = SDLActivity.getContext();
321  final Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
322 
324 
325  switch (display.getRotation()) {
326  case Surface.ROTATION_0:
327  result = SDL_ORIENTATION_PORTRAIT;
328  break;
329 
330  case Surface.ROTATION_90:
331  result = SDL_ORIENTATION_LANDSCAPE;
332  break;
333 
334  case Surface.ROTATION_180:
336  break;
337 
338  case Surface.ROTATION_270:
340  break;
341  }
342 
343  return result;
344  }
GLuint64EXT * result
static final int SDL_ORIENTATION_LANDSCAPE
static screen_context_t context
Definition: video.c:25
static final int SDL_ORIENTATION_PORTRAIT_FLIPPED
static final int SDL_ORIENTATION_LANDSCAPE_FLIPPED
static final int SDL_ORIENTATION_UNKNOWN
static final int SDL_ORIENTATION_PORTRAIT

◆ getDisplayDPI()

static DisplayMetrics org.libsdl.app.SDLActivity.getDisplayDPI ( )
inlinestatic

This method is called by SDL using JNI.

Definition at line 927 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.getContext().

927  {
928  return getContext().getResources().getDisplayMetrics();
929  }
static Context getContext()

◆ getLibraries()

String [] org.libsdl.app.SDLActivity.getLibraries ( )
inlineprotected

This method is called by SDL before loading the native shared libraries. It can be overridden to provide names of shared libraries to be loaded. The default implementation returns the defaults. It never returns null. An array returned by a new implementation must at least contain "SDL2". Also keep in mind that the order the libraries are loaded may matter.

Returns
names of shared libraries to be loaded (e.g. "SDL2", "main").

Definition at line 143 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.getMainSharedObject(), and org.libsdl.app.SDLActivity.loadLibraries().

143  {
144  return new String[] {
145  "SDL2",
146  // "SDL2_image",
147  // "SDL2_mixer",
148  // "SDL2_net",
149  // "SDL2_ttf",
150  "main"
151  };
152  }

◆ getMainFunction()

String org.libsdl.app.SDLActivity.getMainFunction ( )
inlineprotected

This method returns the name of the application entry point It can be overridden by derived classes.

Definition at line 131 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

131  {
132  return "SDL_main";
133  }

◆ getMainSharedObject()

String org.libsdl.app.SDLActivity.getMainSharedObject ( )
inlineprotected

This method returns the name of the shared object with the application entry point It can be overridden by derived classes.

Definition at line 116 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.getContext(), org.libsdl.app.SDLActivity.getLibraries(), and org.libsdl.app.SDLActivity.mSingleton.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

116  {
117  String library;
118  String[] libraries = SDLActivity.mSingleton.getLibraries();
119  if (libraries.length > 0) {
120  library = "lib" + libraries[libraries.length - 1] + ".so";
121  } else {
122  library = "libmain.so";
123  }
124  return getContext().getApplicationInfo().nativeLibraryDir + "/" + library;
125  }
static Context getContext()

◆ getManifestEnvironmentVariables()

static boolean org.libsdl.app.SDLActivity.getManifestEnvironmentVariables ( )
inlinestatic

This method is called by SDL using JNI.

Definition at line 934 of file SDLActivity.java.

References e, org.libsdl.app.SDLActivity.getContext(), and org.libsdl.app.SDLActivity.nativeSetenv().

934  {
935  try {
936  ApplicationInfo applicationInfo = getContext().getPackageManager().getApplicationInfo(getContext().getPackageName(), PackageManager.GET_META_DATA);
937  Bundle bundle = applicationInfo.metaData;
938  if (bundle == null) {
939  return false;
940  }
941  String prefix = "SDL_ENV.";
942  final int trimLength = prefix.length();
943  for (String key : bundle.keySet()) {
944  if (key.startsWith(prefix)) {
945  String name = key.substring(trimLength);
946  String value = bundle.get(key).toString();
947  nativeSetenv(name, value);
948  }
949  }
950  /* environment variables set! */
951  return true;
952  } catch (Exception e) {
953  Log.v("SDL", "exception " + e.toString());
954  }
955  return false;
956  }
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 * e
GLuint const GLchar * name
GLuint64 key
Definition: gl2ext.h:2192
GLsizei const GLfloat * value
static native void nativeSetenv(String name, String value)
static Context getContext()

◆ getMotionListener()

static SDLGenericMotionListener_API12 org.libsdl.app.SDLActivity.getMotionListener ( )
inlinestaticprotected

Definition at line 97 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.mMotionListener.

Referenced by org.libsdl.app.SDLActivity.onWindowFocusChanged(), org.libsdl.app.SDLActivity.setRelativeMouseEnabled(), org.libsdl.app.SDLActivity.setSystemCursor(), and org.libsdl.app.SDLActivity.supportsRelativeMouse().

97  {
98  if (mMotionListener == null) {
99  if (Build.VERSION.SDK_INT >= 26) {
100  mMotionListener = new SDLGenericMotionListener_API26();
101  } else
102  if (Build.VERSION.SDK_INT >= 24) {
103  mMotionListener = new SDLGenericMotionListener_API24();
104  } else {
105  mMotionListener = new SDLGenericMotionListener_API12();
106  }
107  }
108 
109  return mMotionListener;
110  }
static SDLGenericMotionListener_API12 mMotionListener

◆ getNativeSurface()

static Surface org.libsdl.app.SDLActivity.getNativeSurface ( )
inlinestatic

This method is called by SDL using JNI.

Definition at line 1028 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.mSurface.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

1028  {
1029  if (SDLActivity.mSurface == null) {
1030  return null;
1031  }
1032  return SDLActivity.mSurface.getNativeSurface();
1033  }

◆ handleNativeExit()

static void org.libsdl.app.SDLActivity.handleNativeExit ( )
inlinestatic

Definition at line 521 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.mSDLThread.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

521  {
522  SDLActivity.mSDLThread = null;
523  if (mSingleton != null) {
524  mSingleton.finish();
525  }
526  }
static SDLActivity mSingleton

◆ handleNativeState()

static void org.libsdl.app.SDLActivity.handleNativeState ( )
inlinestatic

Definition at line 477 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.NativeState.INIT, org.libsdl.app.SDLActivity.mNextNativeState, org.libsdl.app.SDLActivity.nativePause(), org.libsdl.app.SDLActivity.nativeResume(), org.libsdl.app.SDLActivity.NativeState.PAUSED, and org.libsdl.app.SDLActivity.NativeState.RESUMED.

Referenced by org.libsdl.app.SDLActivity.onDestroy(), org.libsdl.app.SDLActivity.onPause(), org.libsdl.app.SDLActivity.onResume(), org.libsdl.app.SDLActivity.onWindowFocusChanged(), and org.libsdl.app.SDLActivity.setSystemCursor().

477  {
478 
480  // Already in same state, discard.
481  return;
482  }
483 
484  // Try a transition to init state
485  if (mNextNativeState == NativeState.INIT) {
486 
488  return;
489  }
490 
491  // Try a transition to paused state
492  if (mNextNativeState == NativeState.PAUSED) {
493  nativePause();
494  if (mSurface != null)
495  mSurface.handlePause();
497  return;
498  }
499 
500  // Try a transition to resumed state
501  if (mNextNativeState == NativeState.RESUMED) {
502  if (mIsSurfaceReady && mHasFocus && mIsResumedCalled) {
503  if (mSDLThread == null) {
504  // This is the entry point to the C app.
505  // Start up the C app thread and enable sensor input for the first time
506  // FIXME: Why aren't we enabling sensor input at start?
507 
508  mSDLThread = new Thread(new SDLMain(), "SDLThread");
509  mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true);
510  mSDLThread.start();
511  }
512 
513  nativeResume();
514  mSurface.handleResume();
516  }
517  }
518  }
static native void nativeResume()
static SDLSurface mSurface
static boolean mIsResumedCalled
static NativeState mCurrentNativeState
static native void nativePause()
static NativeState mNextNativeState

◆ initialize()

static void org.libsdl.app.SDLActivity.initialize ( )
inlinestatic

Definition at line 171 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.NativeState.INIT.

Referenced by org.libsdl.app.SDL.initialize(), and org.libsdl.app.SDLActivity.onDestroy().

171  {
172  // The static nature of the singleton and Android quirkyness force us to initialize everything here
173  // Otherwise, when exiting the app and returning to it, these variables *keep* their pre exit values
174  mSingleton = null;
175  mSurface = null;
176  mTextEdit = null;
177  mLayout = null;
178  mClipboardHandler = null;
179  mCursors = new Hashtable<Integer, Object>();
180  mLastCursorID = 0;
181  mSDLThread = null;
182  mExitCalledFromJava = false;
183  mBrokenLibraries = false;
184  mIsResumedCalled = false;
185  mIsSurfaceReady = false;
186  mHasFocus = true;
187  mNextNativeState = NativeState.INIT;
188  mCurrentNativeState = NativeState.INIT;
189  }
static boolean mExitCalledFromJava
static Hashtable< Integer, Object > mCursors
static SDLSurface mSurface
static boolean mIsResumedCalled
static NativeState mCurrentNativeState
static boolean mBrokenLibraries
static ViewGroup mLayout
static SDLActivity mSingleton
static SDLClipboardHandler mClipboardHandler
static NativeState mNextNativeState

◆ inputGetInputDeviceIds()

static int [] org.libsdl.app.SDLActivity.inputGetInputDeviceIds ( int  sources)
inlinestatic

This method is called by SDL using JNI.

Returns
an array which may be empty but is never null.

Definition at line 1041 of file SDLActivity.java.

References device, and i.

1041  {
1042  int[] ids = InputDevice.getDeviceIds();
1043  int[] filtered = new int[ids.length];
1044  int used = 0;
1045  for (int i = 0; i < ids.length; ++i) {
1046  InputDevice device = InputDevice.getDevice(ids[i]);
1047  if ((device != null) && ((device.getSources() & sources) != 0)) {
1048  filtered[used++] = device.getId();
1049  }
1050  }
1051  return Arrays.copyOf(filtered, used);
1052  }
GLuint * ids
GLsizei GLenum * sources
static SDL_AudioDeviceID device
Definition: loopwave.c:37
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50

◆ isAndroidTV()

static boolean org.libsdl.app.SDLActivity.isAndroidTV ( )
inlinestatic

This method is called by SDL using JNI.

Definition at line 869 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.getContext().

869  {
870  UiModeManager uiModeManager = (UiModeManager) getContext().getSystemService(UI_MODE_SERVICE);
871  if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
872  return true;
873  }
874  if (Build.MANUFACTURER.equals("MINIX") && Build.MODEL.equals("NEO-U1")) {
875  return true;
876  }
877  if (Build.MANUFACTURER.equals("Amlogic") && Build.MODEL.equals("X96-W")) {
878  return true;
879  }
880  return false;
881  }
static Context getContext()

◆ isChromebook()

static boolean org.libsdl.app.SDLActivity.isChromebook ( )
inlinestatic

This method is called by SDL using JNI.

Definition at line 903 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.getContext().

Referenced by org.libsdl.app.SDLActivity.supportsRelativeMouse().

903  {
904  return getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
905  }
static Context getContext()

◆ isDeXMode()

static boolean org.libsdl.app.SDLActivity.isDeXMode ( )
inlinestatic

This method is called by SDL using JNI.

Definition at line 910 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.getContext().

Referenced by org.libsdl.app.SDLControllerManager.isDeviceSDLJoystick(), and org.libsdl.app.SDLActivity.supportsRelativeMouse().

910  {
911  if (Build.VERSION.SDK_INT < 24) {
912  return false;
913  }
914  try {
915  final Configuration config = getContext().getResources().getConfiguration();
916  final Class configClass = config.getClass();
917  return configClass.getField("SEM_DESKTOP_MODE_ENABLED").getInt(configClass)
918  == configClass.getField("semDesktopModeEnabled").getInt(config);
919  } catch(Exception ignored) {
920  return false;
921  }
922  }
EGLConfig config
Definition: eglext.h:433
static Context getContext()

◆ isScreenKeyboardShown()

static boolean org.libsdl.app.SDLActivity.isScreenKeyboardShown ( )
inlinestatic

This method is called by SDL using JNI.

Definition at line 798 of file SDLActivity.java.

References org.libsdl.app.SDL.getContext().

799  {
800  if (mTextEdit == null) {
801  return false;
802  }
803 
804  if (!mScreenKeyboardShown) {
805  return false;
806  }
807 
808  InputMethodManager imm = (InputMethodManager) SDL.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
809  return imm.isAcceptingText();
810 
811  }
static boolean mScreenKeyboardShown

◆ isTablet()

static boolean org.libsdl.app.SDLActivity.isTablet ( )
inlinestatic

This method is called by SDL using JNI.

Definition at line 886 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.getContext().

886  {
887  DisplayMetrics metrics = new DisplayMetrics();
888  Activity activity = (Activity)getContext();
889  activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
890 
891  double dWidthInches = metrics.widthPixels / (double)metrics.xdpi;
892  double dHeightInches = metrics.heightPixels / (double)metrics.ydpi;
893 
894  double dDiagonal = Math.sqrt((dWidthInches * dWidthInches) + (dHeightInches * dHeightInches));
895 
896  // If our diagonal size is seven inches or greater, we consider ourselves a tablet.
897  return (dDiagonal >= 7.0);
898  }
GLsizei GLenum const void GLuint GLsizei GLfloat * metrics
static Context getContext()

◆ isTextInputEvent()

static boolean org.libsdl.app.SDLActivity.isTextInputEvent ( KeyEvent  event)
inlinestatic

Definition at line 1013 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

1013  {
1014 
1015  // Key pressed with Ctrl should be sent as SDL_KEYDOWN/SDL_KEYUP and not SDL_TEXTINPUT
1016  if (Build.VERSION.SDK_INT >= 11) {
1017  if (event.isCtrlPressed()) {
1018  return false;
1019  }
1020  }
1021 
1022  return event.isPrintingKey() || event.getKeyCode() == KeyEvent.KEYCODE_SPACE;
1023  }
struct _cl_event * event

◆ loadLibraries()

void org.libsdl.app.SDLActivity.loadLibraries ( )
inline

Definition at line 155 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.getLibraries(), and org.libsdl.app.SDL.loadLibrary().

Referenced by org.libsdl.app.SDLActivity.onCreate().

155  {
156  for (String lib : getLibraries()) {
157  SDL.loadLibrary(lib);
158  }
159  }

◆ manualBackButton()

static void org.libsdl.app.SDLActivity.manualBackButton ( )
inlinestatic

Definition at line 437 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.pressBackButton().

437  {
439  }
static SDLActivity mSingleton

◆ messageboxShowMessageBox()

int org.libsdl.app.SDLActivity.messageboxShowMessageBox ( final int  flags,
final String  title,
final String  message,
final int []  buttonFlags,
final int []  buttonIds,
final String []  buttonTexts,
final int []  colors 
)
inline

This method is called by SDL using JNI. Shows the messagebox from UI thread and block calling thread. buttonFlags, buttonIds and buttonTexts must have same length.

Parameters
buttonFlagsarray containing flags for every button.
buttonIdsarray containing id for every button.
buttonTextsarray containing text for every button.
colorsnull for default or array of length 5 containing colors.
Returns
button id or -1.

Definition at line 1142 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.messageboxSelection.

1149  {
1150 
1151  messageboxSelection[0] = -1;
1152 
1153  // sanity checks
1154 
1155  if ((buttonFlags.length != buttonIds.length) && (buttonIds.length != buttonTexts.length)) {
1156  return -1; // implementation broken
1157  }
1158 
1159  // collect arguments for Dialog
1160 
1161  final Bundle args = new Bundle();
1162  args.putInt("flags", flags);
1163  args.putString("title", title);
1164  args.putString("message", message);
1165  args.putIntArray("buttonFlags", buttonFlags);
1166  args.putIntArray("buttonIds", buttonIds);
1167  args.putStringArray("buttonTexts", buttonTexts);
1168  args.putIntArray("colors", colors);
1169 
1170  // trigger Dialog creation on UI thread
1171 
1172  runOnUiThread(new Runnable() {
1173  @Override
1174  public void run() {
1175  showDialog(dialogs++, args);
1176  }
1177  });
1178 
1179  // block the calling thread
1180 
1181  synchronized (messageboxSelection) {
1182  try {
1183  messageboxSelection.wait();
1184  } catch (InterruptedException ex) {
1185  ex.printStackTrace();
1186  return -1;
1187  }
1188  }
1189 
1190  // return selected value
1191 
1192  return messageboxSelection[0];
1193  }
GLuint GLsizei const GLchar * message
GLbitfield flags
static int colors[7]
Definition: testgesture.c:39

◆ nativeGetHint()

◆ nativeLowMemory()

static native void org.libsdl.app.SDLActivity.nativeLowMemory ( )
static

◆ nativePause()

static native void org.libsdl.app.SDLActivity.nativePause ( )
static

◆ nativeQuit()

static native void org.libsdl.app.SDLActivity.nativeQuit ( )
static

◆ nativeResume()

static native void org.libsdl.app.SDLActivity.nativeResume ( )
static

◆ nativeRunMain()

static native int org.libsdl.app.SDLActivity.nativeRunMain ( String  library,
String  function,
Object  arguments 
)
static

◆ nativeSetenv()

static native void org.libsdl.app.SDLActivity.nativeSetenv ( String  name,
String  value 
)
static

◆ nativeSetupJNI()

static native int org.libsdl.app.SDLActivity.nativeSetupJNI ( )
static

◆ onBackPressed()

void org.libsdl.app.SDLActivity.onBackPressed ( )
inline

Definition at line 420 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.nativeGetHint().

420  {
421  // Check if we want to block the back button in case of mouse right click.
422  //
423  // If we do, the normal hardware back button will no longer work and people have to use home,
424  // but the mouse right click will work.
425  //
426  String trapBack = SDLActivity.nativeGetHint("SDL_ANDROID_TRAP_BACK_BUTTON");
427  if ((trapBack != null) && trapBack.equals("1")) {
428  // Exit and let the mouse handler handle this button (if appropriate)
429  return;
430  }
431 
432  // Default system back button behavior.
433  super.onBackPressed();
434  }

◆ onCreate()

void org.libsdl.app.SDLActivity.onCreate ( Bundle  savedInstanceState)
inlineprotected

Definition at line 193 of file SDLActivity.java.

References org.libsdl.app.HIDDeviceManager.acquire(), e, sort_controllers.filename, org.libsdl.app.SDLActivity.getCurrentOrientation(), org.libsdl.app.SDL.initialize(), org.libsdl.app.SDLActivity.loadLibraries(), org.libsdl.app.SDLActivity.mSingleton, org.libsdl.app.SDLActivity.onNativeDropFile(), org.libsdl.app.SDLActivity.onNativeOrientationChanged(), org.libsdl.app.SDL.setContext(), org.libsdl.app.SDL.setupJNI(), and org.libsdl.app.SDLActivity.setWindowStyle().

193  {
194  Log.v(TAG, "Device: " + Build.DEVICE);
195  Log.v(TAG, "Model: " + Build.MODEL);
196  Log.v(TAG, "onCreate()");
197  super.onCreate(savedInstanceState);
198 
199  // Load shared libraries
200  String errorMsgBrokenLib = "";
201  try {
202  loadLibraries();
203  } catch(UnsatisfiedLinkError e) {
204  System.err.println(e.getMessage());
205  mBrokenLibraries = true;
206  errorMsgBrokenLib = e.getMessage();
207  } catch(Exception e) {
208  System.err.println(e.getMessage());
209  mBrokenLibraries = true;
210  errorMsgBrokenLib = e.getMessage();
211  }
212 
213  if (mBrokenLibraries)
214  {
215  mSingleton = this;
216  AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this);
217  dlgAlert.setMessage("An error occurred while trying to start the application. Please try again and/or reinstall."
218  + System.getProperty("line.separator")
219  + System.getProperty("line.separator")
220  + "Error: " + errorMsgBrokenLib);
221  dlgAlert.setTitle("SDL Error");
222  dlgAlert.setPositiveButton("Exit",
223  new DialogInterface.OnClickListener() {
224  @Override
225  public void onClick(DialogInterface dialog,int id) {
226  // if this button is clicked, close current activity
227  SDLActivity.mSingleton.finish();
228  }
229  });
230  dlgAlert.setCancelable(false);
231  dlgAlert.create().show();
232 
233  return;
234  }
235 
236  // Set up JNI
237  SDL.setupJNI();
238 
239  // Initialize state
240  SDL.initialize();
241 
242  // So we can call stuff from static callbacks
243  mSingleton = this;
244  SDL.setContext(this);
245 
246  if (Build.VERSION.SDK_INT >= 11) {
247  mClipboardHandler = new SDLClipboardHandler_API11();
248  } else {
249  /* Before API 11, no clipboard notification (eg no SDL_CLIPBOARDUPDATE) */
250  mClipboardHandler = new SDLClipboardHandler_Old();
251  }
252 
253  mHIDDeviceManager = HIDDeviceManager.acquire(this);
254 
255  // Set up the surface
256  mSurface = new SDLSurface(getApplication());
257 
258  mLayout = new RelativeLayout(this);
259  mLayout.addView(mSurface);
260 
261  // Get our current screen orientation and pass it down.
262  mCurrentOrientation = SDLActivity.getCurrentOrientation();
263  SDLActivity.onNativeOrientationChanged(mCurrentOrientation);
264 
265  setContentView(mLayout);
266 
267  setWindowStyle(false);
268 
269  getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(this);
270 
271  // Get filename from "Open with" of another application
272  Intent intent = getIntent();
273  if (intent != null && intent.getData() != null) {
274  String filename = intent.getData().getPath();
275  if (filename != null) {
276  Log.v(TAG, "Got filename: " + filename);
277  SDLActivity.onNativeDropFile(filename);
278  }
279  }
280  }
static final String TAG
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 * e
static HIDDeviceManager acquire(Context context)
static SDLSurface mSurface
static boolean mBrokenLibraries
static void setWindowStyle(boolean fullscreen)
static ViewGroup mLayout
static HIDDeviceManager mHIDDeviceManager
static SDLActivity mSingleton
static SDLClipboardHandler mClipboardHandler

◆ onCreateDialog()

Dialog org.libsdl.app.SDLActivity.onCreateDialog ( int  ignore,
Bundle  args 
)
inlineprotected

Definition at line 1196 of file SDLActivity.java.

References buttons, colors, d, i, org.libsdl.app.SDLActivity.messageboxSelection, and textColor.

1196  {
1197 
1198  // TODO set values from "flags" to messagebox dialog
1199 
1200  // get colors
1201 
1202  int[] colors = args.getIntArray("colors");
1203  int backgroundColor;
1204  int textColor;
1205  int buttonBorderColor;
1206  int buttonBackgroundColor;
1207  int buttonSelectedColor;
1208  if (colors != null) {
1209  int i = -1;
1210  backgroundColor = colors[++i];
1211  textColor = colors[++i];
1212  buttonBorderColor = colors[++i];
1213  buttonBackgroundColor = colors[++i];
1214  buttonSelectedColor = colors[++i];
1215  } else {
1216  backgroundColor = Color.TRANSPARENT;
1217  textColor = Color.TRANSPARENT;
1218  buttonBorderColor = Color.TRANSPARENT;
1219  buttonBackgroundColor = Color.TRANSPARENT;
1220  buttonSelectedColor = Color.TRANSPARENT;
1221  }
1222 
1223  // create dialog with title and a listener to wake up calling thread
1224 
1225  final Dialog dialog = new Dialog(this);
1226  dialog.setTitle(args.getString("title"));
1227  dialog.setCancelable(false);
1228  dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
1229  @Override
1230  public void onDismiss(DialogInterface unused) {
1231  synchronized (messageboxSelection) {
1232  messageboxSelection.notify();
1233  }
1234  }
1235  });
1236 
1237  // create text
1238 
1239  TextView message = new TextView(this);
1240  message.setGravity(Gravity.CENTER);
1241  message.setText(args.getString("message"));
1242  if (textColor != Color.TRANSPARENT) {
1243  message.setTextColor(textColor);
1244  }
1245 
1246  // create buttons
1247 
1248  int[] buttonFlags = args.getIntArray("buttonFlags");
1249  int[] buttonIds = args.getIntArray("buttonIds");
1250  String[] buttonTexts = args.getStringArray("buttonTexts");
1251 
1252  final SparseArray<Button> mapping = new SparseArray<Button>();
1253 
1254  LinearLayout buttons = new LinearLayout(this);
1255  buttons.setOrientation(LinearLayout.HORIZONTAL);
1256  buttons.setGravity(Gravity.CENTER);
1257  for (int i = 0; i < buttonTexts.length; ++i) {
1258  Button button = new Button(this);
1259  final int id = buttonIds[i];
1260  button.setOnClickListener(new View.OnClickListener() {
1261  @Override
1262  public void onClick(View v) {
1263  messageboxSelection[0] = id;
1264  dialog.dismiss();
1265  }
1266  });
1267  if (buttonFlags[i] != 0) {
1268  // see SDL_messagebox.h
1269  if ((buttonFlags[i] & 0x00000001) != 0) {
1270  mapping.put(KeyEvent.KEYCODE_ENTER, button);
1271  }
1272  if ((buttonFlags[i] & 0x00000002) != 0) {
1273  mapping.put(KeyEvent.KEYCODE_ESCAPE, button); /* API 11 */
1274  }
1275  }
1276  button.setText(buttonTexts[i]);
1277  if (textColor != Color.TRANSPARENT) {
1278  button.setTextColor(textColor);
1279  }
1280  if (buttonBorderColor != Color.TRANSPARENT) {
1281  // TODO set color for border of messagebox button
1282  }
1283  if (buttonBackgroundColor != Color.TRANSPARENT) {
1284  Drawable drawable = button.getBackground();
1285  if (drawable == null) {
1286  // setting the color this way removes the style
1287  button.setBackgroundColor(buttonBackgroundColor);
1288  } else {
1289  // setting the color this way keeps the style (gradient, padding, etc.)
1290  drawable.setColorFilter(buttonBackgroundColor, PorterDuff.Mode.MULTIPLY);
1291  }
1292  }
1293  if (buttonSelectedColor != Color.TRANSPARENT) {
1294  // TODO set color for selected messagebox button
1295  }
1296  buttons.addView(button);
1297  }
1298 
1299  // create content
1300 
1301  LinearLayout content = new LinearLayout(this);
1302  content.setOrientation(LinearLayout.VERTICAL);
1303  content.addView(message);
1304  content.addView(buttons);
1305  if (backgroundColor != Color.TRANSPARENT) {
1306  content.setBackgroundColor(backgroundColor);
1307  }
1308 
1309  // add content to dialog and return
1310 
1311  dialog.setContentView(content);
1312  dialog.setOnKeyListener(new Dialog.OnKeyListener() {
1313  @Override
1314  public boolean onKey(DialogInterface d, int keyCode, KeyEvent event) {
1315  Button button = mapping.get(keyCode);
1316  if (button != null) {
1317  if (event.getAction() == KeyEvent.ACTION_UP) {
1318  button.performClick();
1319  }
1320  return true; // also for ignored actions
1321  }
1322  return false;
1323  }
1324  });
1325 
1326  return dialog;
1327  }
GLuint id
SDL_Texture * button
const GLdouble * v
Definition: SDL_opengl.h:2064
GLuint GLsizei const GLchar * message
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 ** d
struct _cl_event * event
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
GLenum GLenum GLenum GLenum mapping
static int colors[7]
Definition: testgesture.c:39
static struct @63 buttons[NUM_DRUMS]
static SDL_Color textColor
Definition: testime.c:46

◆ onDestroy()

void org.libsdl.app.SDLActivity.onDestroy ( )
inlineprotected

Definition at line 379 of file SDLActivity.java.

References e, org.libsdl.app.SDLActivity.handleNativeState(), org.libsdl.app.SDLActivity.initialize(), org.libsdl.app.SDLActivity.mBrokenLibraries, org.libsdl.app.SDLActivity.mExitCalledFromJava, org.libsdl.app.SDLActivity.mSDLThread, org.libsdl.app.SDLActivity.nativeQuit(), org.libsdl.app.SDLActivity.NativeState.PAUSED, and org.libsdl.app.HIDDeviceManager.release().

379  {
380  Log.v(TAG, "onDestroy()");
381 
382  if (mHIDDeviceManager != null) {
383  HIDDeviceManager.release(mHIDDeviceManager);
384  mHIDDeviceManager = null;
385  }
386 
387  if (SDLActivity.mBrokenLibraries) {
388  super.onDestroy();
389  // Reset everything in case the user re opens the app
390  SDLActivity.initialize();
391  return;
392  }
393 
394  mNextNativeState = NativeState.PAUSED;
395  SDLActivity.handleNativeState();
396 
397  // Send a quit message to the application
398  SDLActivity.mExitCalledFromJava = true;
399  SDLActivity.nativeQuit();
400 
401  // Now wait for the SDL thread to quit
402  if (SDLActivity.mSDLThread != null) {
403  try {
404  SDLActivity.mSDLThread.join();
405  } catch(Exception e) {
406  Log.v(TAG, "Problem stopping thread: " + e);
407  }
408  SDLActivity.mSDLThread = null;
409 
410  //Log.v(TAG, "Finished waiting for SDL thread");
411  }
412 
413  super.onDestroy();
414 
415  // Reset everything in case the user re opens the app
416  SDLActivity.initialize();
417  }
static final String TAG
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 * e
static HIDDeviceManager mHIDDeviceManager
static NativeState mNextNativeState

◆ onLowMemory()

void org.libsdl.app.SDLActivity.onLowMemory ( )
inline

Definition at line 367 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.mBrokenLibraries, and org.libsdl.app.SDLActivity.nativeLowMemory().

367  {
368  Log.v(TAG, "onLowMemory()");
369  super.onLowMemory();
370 
371  if (SDLActivity.mBrokenLibraries) {
372  return;
373  }
374 
375  SDLActivity.nativeLowMemory();
376  }
static final String TAG

◆ onNativeAccel()

static native void org.libsdl.app.SDLActivity.onNativeAccel ( float  x,
float  y,
float  z 
)
static

◆ onNativeClipboardChanged()

static native void org.libsdl.app.SDLActivity.onNativeClipboardChanged ( )
static

◆ onNativeDropFile()

static native void org.libsdl.app.SDLActivity.onNativeDropFile ( String  filename)
static

◆ onNativeKeyboardFocusLost()

static native void org.libsdl.app.SDLActivity.onNativeKeyboardFocusLost ( )
static

◆ onNativeKeyDown()

static native void org.libsdl.app.SDLActivity.onNativeKeyDown ( int  keycode)
static

◆ onNativeKeyUp()

static native void org.libsdl.app.SDLActivity.onNativeKeyUp ( int  keycode)
static

◆ onNativeMouse()

static native void org.libsdl.app.SDLActivity.onNativeMouse ( int  button,
int  action,
float  x,
float  y,
boolean  relative 
)
static

◆ onNativeOrientationChanged()

static native void org.libsdl.app.SDLActivity.onNativeOrientationChanged ( int  orientation)
static

◆ onNativeResize()

static native void org.libsdl.app.SDLActivity.onNativeResize ( int  surfaceWidth,
int  surfaceHeight,
int  deviceWidth,
int  deviceHeight,
int  format,
float  rate 
)
static

◆ onNativeSurfaceChanged()

static native void org.libsdl.app.SDLActivity.onNativeSurfaceChanged ( )
static

◆ onNativeSurfaceDestroyed()

static native void org.libsdl.app.SDLActivity.onNativeSurfaceDestroyed ( )
static

◆ onNativeTouch()

static native void org.libsdl.app.SDLActivity.onNativeTouch ( int  touchDevId,
int  pointerFingerId,
int  action,
float  x,
float  y,
float  p 
)
static

◆ onPause()

void org.libsdl.app.SDLActivity.onPause ( )
inlineprotected

Definition at line 284 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.handleNativeState(), org.libsdl.app.SDLActivity.mBrokenLibraries, org.libsdl.app.SDLActivity.NativeState.PAUSED, and org.libsdl.app.HIDDeviceManager.setFrozen().

284  {
285  Log.v(TAG, "onPause()");
286  super.onPause();
287  mNextNativeState = NativeState.PAUSED;
288  mIsResumedCalled = false;
289 
290  if (SDLActivity.mBrokenLibraries) {
291  return;
292  }
293 
294  if (mHIDDeviceManager != null) {
296  }
297 
298  SDLActivity.handleNativeState();
299  }
static final String TAG
static boolean mIsResumedCalled
static HIDDeviceManager mHIDDeviceManager
static NativeState mNextNativeState

◆ onResume()

void org.libsdl.app.SDLActivity.onResume ( )
inlineprotected

Definition at line 302 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.handleNativeState(), org.libsdl.app.SDLActivity.mBrokenLibraries, org.libsdl.app.SDLActivity.NativeState.RESUMED, and org.libsdl.app.HIDDeviceManager.setFrozen().

302  {
303  Log.v(TAG, "onResume()");
304  super.onResume();
305  mNextNativeState = NativeState.RESUMED;
306  mIsResumedCalled = true;
307 
308  if (SDLActivity.mBrokenLibraries) {
309  return;
310  }
311 
312  if (mHIDDeviceManager != null) {
314  }
315 
316  SDLActivity.handleNativeState();
317  }
static final String TAG
static boolean mIsResumedCalled
static HIDDeviceManager mHIDDeviceManager
static NativeState mNextNativeState

◆ onSystemUiVisibilityChange()

void org.libsdl.app.SDLActivity.onSystemUiVisibilityChange ( int  visibility)
inline

Definition at line 1343 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.mFullscreenModeActive.

1343  {
1344  if (SDLActivity.mFullscreenModeActive && (visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0 || (visibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0) {
1345 
1346  Handler handler = getWindow().getDecorView().getHandler();
1347  if (handler != null) {
1348  handler.removeCallbacks(rehideSystemUi); // Prevent a hide loop.
1349  handler.postDelayed(rehideSystemUi, 2000);
1350  }
1351 
1352  }
1353  }

◆ onUnhandledMessage()

boolean org.libsdl.app.SDLActivity.onUnhandledMessage ( int  command,
Object  param 
)
inlineprotected

This method is called by SDL if SDL did not handle a message itself. This happens if a received message contains an unsupported command. Method can be overwritten to handle Messages in a different class.

Parameters
commandthe command of the message.
paramthe parameter of the message. May be null.
Returns
if the message was handled in overridden method.

Definition at line 547 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.SDLCommandHandler.handleMessage().

547  {
548  return false;
549  }

◆ onWindowFocusChanged()

void org.libsdl.app.SDLActivity.onWindowFocusChanged ( boolean  hasFocus)
inline

Definition at line 347 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.getMotionListener(), org.libsdl.app.SDLActivity.handleNativeState(), org.libsdl.app.SDLActivity.mBrokenLibraries, org.libsdl.app.SDLActivity.NativeState.PAUSED, and org.libsdl.app.SDLActivity.NativeState.RESUMED.

347  {
348  super.onWindowFocusChanged(hasFocus);
349  Log.v(TAG, "onWindowFocusChanged(): " + hasFocus);
350 
351  if (SDLActivity.mBrokenLibraries) {
352  return;
353  }
354 
355  SDLActivity.mHasFocus = hasFocus;
356  if (hasFocus) {
357  mNextNativeState = NativeState.RESUMED;
358  SDLActivity.getMotionListener().reclaimRelativeMouseModeIfNeeded();
359  } else {
360  mNextNativeState = NativeState.PAUSED;
361  }
362 
363  SDLActivity.handleNativeState();
364  }
static final String TAG
static NativeState mNextNativeState

◆ openAPKExpansionInputStream()

static InputStream org.libsdl.app.SDLActivity.openAPKExpansionInputStream ( String  fileName) throws IOException
inlinestatic

This method is called by SDL using JNI.

Returns
an InputStream on success or null if no expansion file was used.
Exceptions
IOExceptionon errors. Message is set for the SDL error message.

Definition at line 1067 of file SDLActivity.java.

References org.libsdl.app.SDL.getContext(), and org.libsdl.app.SDLActivity.nativeGetHint().

1067  {
1068  // Get a ZipResourceFile representing a merger of both the main and patch files
1069  if (expansionFile == null) {
1070  String mainHint = nativeGetHint("SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION");
1071  if (mainHint == null) {
1072  return null; // no expansion use if no main version was set
1073  }
1074  String patchHint = nativeGetHint("SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION");
1075  if (patchHint == null) {
1076  return null; // no expansion use if no patch version was set
1077  }
1078 
1079  Integer mainVersion;
1080  Integer patchVersion;
1081  try {
1082  mainVersion = Integer.valueOf(mainHint);
1083  patchVersion = Integer.valueOf(patchHint);
1084  } catch (NumberFormatException ex) {
1085  ex.printStackTrace();
1086  throw new IOException("No valid file versions set for APK expansion files", ex);
1087  }
1088 
1089  try {
1090  // To avoid direct dependency on Google APK expansion library that is
1091  // not a part of Android SDK we access it using reflection
1092  expansionFile = Class.forName("com.android.vending.expansion.zipfile.APKExpansionSupport")
1093  .getMethod("getAPKExpansionZipFile", Context.class, int.class, int.class)
1094  .invoke(null, SDL.getContext(), mainVersion, patchVersion);
1095 
1096  expansionFileMethod = expansionFile.getClass()
1097  .getMethod("getInputStream", String.class);
1098  } catch (Exception ex) {
1099  ex.printStackTrace();
1100  expansionFile = null;
1101  expansionFileMethod = null;
1102  throw new IOException("Could not access APK expansion support library", ex);
1103  }
1104  }
1105 
1106  // Get an input stream for a known file inside the expansion file ZIPs
1107  InputStream fileStream;
1108  try {
1109  fileStream = (InputStream)expansionFileMethod.invoke(expansionFile, fileName);
1110  } catch (Exception ex) {
1111  // calling "getInputStream" failed
1112  ex.printStackTrace();
1113  throw new IOException("Could not open stream from APK expansion file", ex);
1114  }
1115 
1116  if (fileStream == null) {
1117  // calling "getInputStream" was successful but null was returned
1118  throw new IOException("Could not find path in APK expansion file");
1119  }
1120 
1121  return fileStream;
1122  }
static native String nativeGetHint(String name)
static Method expansionFileMethod

◆ pressBackButton()

void org.libsdl.app.SDLActivity.pressBackButton ( )
inline

Definition at line 442 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.superOnBackPressed().

Referenced by org.libsdl.app.SDLActivity.manualBackButton().

442  {
443  runOnUiThread(new Runnable() {
444  @Override
445  public void run() {
446  SDLActivity.this.superOnBackPressed();
447  }
448  });
449  }

◆ sendMessage()

static boolean org.libsdl.app.SDLActivity.sendMessage ( int  command,
int  param 
)
inlinestatic

This method is called by SDL using JNI.

Definition at line 852 of file SDLActivity.java.

852  {
853  if (mSingleton == null) {
854  return false;
855  }
856  return mSingleton.sendCommand(command, Integer.valueOf(param));
857  }
static SDLActivity mSingleton
GLfloat param

◆ setActivityTitle()

static boolean org.libsdl.app.SDLActivity.setActivityTitle ( String  title)
inlinestatic

This method is called by SDL using JNI.

Definition at line 730 of file SDLActivity.java.

730  {
731  // Called from SDLMain() thread and can't directly affect the view
732  return mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title);
733  }
static SDLActivity mSingleton

◆ setCustomCursor()

static boolean org.libsdl.app.SDLActivity.setCustomCursor ( int  cursorID)
inlinestatic

This method is called by SDL using JNI.

Definition at line 1397 of file SDLActivity.java.

References e.

1397  {
1398  // This requires API 24, so use reflection to implement this
1399  try {
1400  Class PointerIconClass = Class.forName("android.view.PointerIcon");
1401  Method setPointerIcon = SDLSurface.class.getMethod("setPointerIcon", PointerIconClass);
1402  setPointerIcon.invoke(mSurface, mCursors.get(cursorID));
1403  } catch (Exception e) {
1404  return false;
1405  }
1406  return true;
1407  }
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 * e
static Hashtable< Integer, Object > mCursors
static SDLSurface mSurface

◆ setOrientation()

static void org.libsdl.app.SDLActivity.setOrientation ( int  w,
int  h,
boolean  resizable,
String  hint 
)
inlinestatic

This method is called by SDL using JNI. This is a static method for JNI convenience, it calls a non-static method so that is can be overridden

Definition at line 748 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.setOrientationBis().

749  {
750  if (mSingleton != null) {
751  mSingleton.setOrientationBis(w, h, resizable, hint);
752  }
753  }
GLfloat GLfloat GLfloat GLfloat h
GLubyte GLubyte GLubyte GLubyte w
void setOrientationBis(int w, int h, boolean resizable, String hint)
static SDLActivity mSingleton

◆ setOrientationBis()

void org.libsdl.app.SDLActivity.setOrientationBis ( int  w,
int  h,
boolean  resizable,
String  hint 
)
inline

This can be overridden

Definition at line 758 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setOrientation().

759  {
760  int orientation = -1;
761 
762  if (hint.contains("LandscapeRight") && hint.contains("LandscapeLeft")) {
763  orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
764  } else if (hint.contains("LandscapeRight")) {
765  orientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
766  } else if (hint.contains("LandscapeLeft")) {
767  orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
768  } else if (hint.contains("Portrait") && hint.contains("PortraitUpsideDown")) {
769  orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;
770  } else if (hint.contains("Portrait")) {
771  orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
772  } else if (hint.contains("PortraitUpsideDown")) {
773  orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
774  }
775 
776  /* no valid hint */
777  if (orientation == -1) {
778  if (resizable) {
779  /* no fixed orientation */
780  } else {
781  if (w > h) {
782  orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
783  } else {
784  orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;
785  }
786  }
787  }
788 
789  Log.v("SDL", "setOrientation() orientation=" + orientation + " width=" + w +" height="+ h +" resizable=" + resizable + " hint=" + hint);
790  if (orientation != -1) {
791  mSingleton.setRequestedOrientation(orientation);
792  }
793  }
GLfloat GLfloat GLfloat GLfloat h
GLubyte GLubyte GLubyte GLubyte w
static SDLActivity mSingleton

◆ setRelativeMouseEnabled()

static boolean org.libsdl.app.SDLActivity.setRelativeMouseEnabled ( boolean  enabled)
inlinestatic

This method is called by SDL using JNI.

Definition at line 840 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.getMotionListener(), and org.libsdl.app.SDLActivity.supportsRelativeMouse().

841  {
842  if (enabled && !supportsRelativeMouse()) {
843  return false;
844  }
845 
846  return SDLActivity.getMotionListener().setRelativeMouseEnabled(enabled);
847  }
static boolean supportsRelativeMouse()
GLenum GLenum GLsizei const GLuint GLboolean enabled

◆ setSystemCursor()

static boolean org.libsdl.app.SDLActivity.setSystemCursor ( int  cursorID)
inlinestatic

This method is called by SDL using JNI.

Definition at line 1412 of file SDLActivity.java.

References button, org.libsdl.app.SDLActivity.clipboardGetText(), org.libsdl.app.SDLActivity.clipboardHasText(), org.libsdl.app.SDLActivity.clipboardSetText(), context, e, org.libsdl.app.SDLActivity.getArguments(), org.libsdl.app.SDL.getContext(), org.libsdl.app.SDLActivity.getContext(), org.libsdl.app.SDLActivity.getMainFunction(), org.libsdl.app.SDLActivity.getMainSharedObject(), org.libsdl.app.SDLActivity.getMotionListener(), org.libsdl.app.SDLActivity.getNativeSurface(), org.libsdl.app.SDLActivity.handleNativeExit(), org.libsdl.app.SDLActivity.handleNativeState(), i, org.libsdl.app.SDLControllerManager.isDeviceSDLJoystick(), org.libsdl.app.SDLActivity.isTextInputEvent(), org.libsdl.app.SDLActivity.mCurrentOrientation, org.libsdl.app.SDLActivity.mExitCalledFromJava, org.libsdl.app.SDLActivity.mNextNativeState, org.libsdl.app.SDLActivity.mSeparateMouseAndTouch, org.libsdl.app.SDLActivity.mSingleton, org.libsdl.app.SDLActivity.mTextEdit, org.libsdl.app.SDLActivity.nativeGetHint(), org.libsdl.app.SDLActivity.nativeRunMain(), org.libsdl.app.SDLActivity.onNativeAccel(), org.libsdl.app.SDLActivity.onNativeClipboardChanged(), org.libsdl.app.SDLActivity.onNativeKeyboardFocusLost(), org.libsdl.app.SDLActivity.onNativeKeyDown(), org.libsdl.app.SDLActivity.onNativeKeyUp(), org.libsdl.app.SDLActivity.onNativeMouse(), org.libsdl.app.SDLActivity.onNativeOrientationChanged(), org.libsdl.app.SDLControllerManager.onNativePadDown(), org.libsdl.app.SDLControllerManager.onNativePadUp(), org.libsdl.app.SDLActivity.onNativeResize(), org.libsdl.app.SDLActivity.onNativeSurfaceChanged(), org.libsdl.app.SDLActivity.onNativeSurfaceDestroyed(), org.libsdl.app.SDLActivity.onNativeTouch(), org.libsdl.app.SDLActivity.NativeState.PAUSED, org.libsdl.app.SDLActivity.SDL_ORIENTATION_LANDSCAPE, org.libsdl.app.SDLActivity.SDL_ORIENTATION_LANDSCAPE_FLIPPED, org.libsdl.app.SDLActivity.SDL_ORIENTATION_PORTRAIT, org.libsdl.app.SDLActivity.SDL_ORIENTATION_PORTRAIT_FLIPPED, org.libsdl.app.SDLActivity.SDL_ORIENTATION_UNKNOWN, org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_ARROW, org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_CROSSHAIR, org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_HAND, org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_IBEAM, org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_NO, org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_SIZEALL, org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_SIZENESW, org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_SIZENS, org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_SIZENWSE, org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_SIZEWE, org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_WAIT, org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_WAITARROW, and text.

1412  {
1413  int cursor_type = 0; //PointerIcon.TYPE_NULL;
1414  switch (cursorID) {
1416  cursor_type = 1000; //PointerIcon.TYPE_ARROW;
1417  break;
1419  cursor_type = 1008; //PointerIcon.TYPE_TEXT;
1420  break;
1422  cursor_type = 1004; //PointerIcon.TYPE_WAIT;
1423  break;
1425  cursor_type = 1007; //PointerIcon.TYPE_CROSSHAIR;
1426  break;
1428  cursor_type = 1004; //PointerIcon.TYPE_WAIT;
1429  break;
1431  cursor_type = 1017; //PointerIcon.TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW;
1432  break;
1434  cursor_type = 1016; //PointerIcon.TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW;
1435  break;
1437  cursor_type = 1014; //PointerIcon.TYPE_HORIZONTAL_DOUBLE_ARROW;
1438  break;
1440  cursor_type = 1015; //PointerIcon.TYPE_VERTICAL_DOUBLE_ARROW;
1441  break;
1443  cursor_type = 1020; //PointerIcon.TYPE_GRAB;
1444  break;
1445  case SDL_SYSTEM_CURSOR_NO:
1446  cursor_type = 1012; //PointerIcon.TYPE_NO_DROP;
1447  break;
1449  cursor_type = 1002; //PointerIcon.TYPE_HAND;
1450  break;
1451  }
1452  // This requires API 24, so use reflection to implement this
1453  try {
1454  Class PointerIconClass = Class.forName("android.view.PointerIcon");
1455  Class[] arg_types = new Class[] { Context.class, int.class };
1456  Method getSystemIcon = PointerIconClass.getMethod("getSystemIcon", arg_types);
1457  Method setPointerIcon = SDLSurface.class.getMethod("setPointerIcon", PointerIconClass);
1458  setPointerIcon.invoke(mSurface, getSystemIcon.invoke(null, SDL.getContext(), cursor_type));
1459  } catch (Exception e) {
1460  return false;
1461  }
1462  return true;
1463  }
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 * e
static final int SDL_SYSTEM_CURSOR_SIZEWE
static final int SDL_SYSTEM_CURSOR_IBEAM
static final int SDL_SYSTEM_CURSOR_WAIT
static SDLSurface mSurface
static final int SDL_SYSTEM_CURSOR_SIZEALL
static final int SDL_SYSTEM_CURSOR_NO
static final int SDL_SYSTEM_CURSOR_HAND
static final int SDL_SYSTEM_CURSOR_SIZENESW
static final int SDL_SYSTEM_CURSOR_SIZENWSE
static final int SDL_SYSTEM_CURSOR_ARROW
static final int SDL_SYSTEM_CURSOR_SIZENS
static final int SDL_SYSTEM_CURSOR_CROSSHAIR
static final int SDL_SYSTEM_CURSOR_WAITARROW

◆ setWindowStyle()

static void org.libsdl.app.SDLActivity.setWindowStyle ( boolean  fullscreen)
inlinestatic

This method is called by SDL using JNI.

Definition at line 738 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.onCreate().

738  {
739  // Called from SDLMain() thread and can't directly affect the view
740  mSingleton.sendCommand(COMMAND_CHANGE_WINDOW_STYLE, fullscreen ? 1 : 0);
741  }
static SDLActivity mSingleton

◆ showTextInput()

static boolean org.libsdl.app.SDLActivity.showTextInput ( int  x,
int  y,
int  w,
int  h 
)
inlinestatic

This method is called by SDL using JNI.

Definition at line 1008 of file SDLActivity.java.

1008  {
1009  // Transfer the task to the main thread as a Runnable
1010  return mSingleton.commandHandler.post(new ShowTextInputTask(x, y, w, h));
1011  }
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
GLfloat GLfloat GLfloat GLfloat h
GLubyte GLubyte GLubyte GLubyte w
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
static SDLActivity mSingleton

◆ superOnBackPressed()

void org.libsdl.app.SDLActivity.superOnBackPressed ( )
inline

Definition at line 452 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.pressBackButton().

452  {
453  super.onBackPressed();
454  }

◆ supportsRelativeMouse()

static boolean org.libsdl.app.SDLActivity.supportsRelativeMouse ( )
inlinestatic

This method is called by SDL using JNI.

Definition at line 816 of file SDLActivity.java.

References org.libsdl.app.SDLActivity.getMotionListener(), org.libsdl.app.SDLActivity.isChromebook(), and org.libsdl.app.SDLActivity.isDeXMode().

Referenced by org.libsdl.app.SDLActivity.setRelativeMouseEnabled().

817  {
818  // ChromeOS doesn't provide relative mouse motion via the Android 7 APIs
819  if (isChromebook()) {
820  return false;
821  }
822 
823  // DeX mode in Samsung Experience 9.0 and earlier doesn't support relative mice properly under
824  // Android 7 APIs, and simply returns no data under Android 8 APIs.
825  //
826  // This is fixed in Samsung Experience 9.5, which corresponds to Android 8.1.0, and
827  // thus SDK version 27. If we are in DeX mode and not API 27 or higher, as a result,
828  // we should stick to relative mode.
829  //
830  if ((Build.VERSION.SDK_INT < 27) && isDeXMode()) {
831  return false;
832  }
833 
834  return SDLActivity.getMotionListener().supportsRelativeMouse();
835  }
static boolean isDeXMode()
static boolean isChromebook()

Field Documentation

◆ COMMAND_USER

final int org.libsdl.app.SDLActivity.COMMAND_USER = 0x8000
staticprotected

Definition at line 535 of file SDLActivity.java.

◆ dialogs

int org.libsdl.app.SDLActivity.dialogs = 0
protected

Id of current dialog.

Definition at line 1130 of file SDLActivity.java.

◆ expansionFile

Object org.libsdl.app.SDLActivity.expansionFile
staticprivate

com.android.vending.expansion.zipfile.ZipResourceFile object or null.

Definition at line 1057 of file SDLActivity.java.

◆ expansionFileMethod

Method org.libsdl.app.SDLActivity.expansionFileMethod
staticprivate

com.android.vending.expansion.zipfile.ZipResourceFile's getInputStream() or null.

Definition at line 1060 of file SDLActivity.java.

◆ mBrokenLibraries

boolean org.libsdl.app.SDLActivity.mBrokenLibraries
static

◆ mClipboardHandler

SDLClipboardHandler org.libsdl.app.SDLActivity.mClipboardHandler
staticprotected

Definition at line 88 of file SDLActivity.java.

◆ mCurrentNativeState

NativeState org.libsdl.app.SDLActivity.mCurrentNativeState
static

Definition at line 71 of file SDLActivity.java.

◆ mCurrentOrientation

int org.libsdl.app.SDLActivity.mCurrentOrientation
staticprotected

Definition at line 63 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ mCursors

Hashtable<Integer, Object> org.libsdl.app.SDLActivity.mCursors
staticprotected

Definition at line 89 of file SDLActivity.java.

◆ messageboxSelection

final int [] org.libsdl.app.SDLActivity.messageboxSelection = new int[1]
protected

Result of current messagebox. Also used for blocking the calling thread.

Definition at line 1127 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.messageboxShowMessageBox(), and org.libsdl.app.SDLActivity.onCreateDialog().

◆ mExitCalledFromJava

boolean org.libsdl.app.SDLActivity.mExitCalledFromJava
static

◆ mFullscreenModeActive

boolean org.libsdl.app.SDLActivity.mFullscreenModeActive
staticprotected

◆ mHIDDeviceManager

HIDDeviceManager org.libsdl.app.SDLActivity.mHIDDeviceManager
staticprotected

Definition at line 92 of file SDLActivity.java.

◆ mIsResumedCalled

boolean org.libsdl.app.SDLActivity.mIsResumedCalled
static

Definition at line 40 of file SDLActivity.java.

◆ mLastCursorID

int org.libsdl.app.SDLActivity.mLastCursorID
staticprotected

Definition at line 90 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.createCustomCursor().

◆ mLayout

ViewGroup org.libsdl.app.SDLActivity.mLayout
staticprotected

Definition at line 87 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.getContentView().

◆ mMotionListener

SDLGenericMotionListener_API12 org.libsdl.app.SDLActivity.mMotionListener
staticprotected

Definition at line 91 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.getMotionListener().

◆ mNextNativeState

NativeState org.libsdl.app.SDLActivity.mNextNativeState
static

◆ mScreenKeyboardShown

boolean org.libsdl.app.SDLActivity.mScreenKeyboardShown
staticprotected

Definition at line 86 of file SDLActivity.java.

◆ mSDLThread

Thread org.libsdl.app.SDLActivity.mSDLThread
staticprotected

◆ mSeparateMouseAndTouch

boolean org.libsdl.app.SDLActivity.mSeparateMouseAndTouch
static

◆ mSingleton

SDLActivity org.libsdl.app.SDLActivity.mSingleton
staticprotected

◆ mSurface

SDLSurface org.libsdl.app.SDLActivity.mSurface
staticprotected

Definition at line 84 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.getNativeSurface().

◆ mTextEdit

View org.libsdl.app.SDLActivity.mTextEdit
staticprotected

Definition at line 85 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ rehideSystemUi

final Runnable org.libsdl.app.SDLActivity.rehideSystemUi
private
Initial value:
= new Runnable() {
@Override
public void run() {
int flags = View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;
SDLActivity.this.getWindow().getDecorView().setSystemUiVisibility(flags);
}
}

Definition at line 1329 of file SDLActivity.java.

◆ SDL_ORIENTATION_LANDSCAPE

final int org.libsdl.app.SDLActivity.SDL_ORIENTATION_LANDSCAPE = 1
staticprotected

◆ SDL_ORIENTATION_LANDSCAPE_FLIPPED

final int org.libsdl.app.SDLActivity.SDL_ORIENTATION_LANDSCAPE_FLIPPED = 2
staticprotected

◆ SDL_ORIENTATION_PORTRAIT

final int org.libsdl.app.SDLActivity.SDL_ORIENTATION_PORTRAIT = 3
staticprotected

◆ SDL_ORIENTATION_PORTRAIT_FLIPPED

final int org.libsdl.app.SDLActivity.SDL_ORIENTATION_PORTRAIT_FLIPPED = 4
staticprotected

◆ SDL_ORIENTATION_UNKNOWN

final int org.libsdl.app.SDLActivity.SDL_ORIENTATION_UNKNOWN = 0
staticprotected

◆ SDL_SYSTEM_CURSOR_ARROW

final int org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_ARROW = 0
staticprivate

Definition at line 44 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ SDL_SYSTEM_CURSOR_CROSSHAIR

final int org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_CROSSHAIR = 3
staticprivate

Definition at line 47 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ SDL_SYSTEM_CURSOR_HAND

final int org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_HAND = 11
staticprivate

Definition at line 55 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ SDL_SYSTEM_CURSOR_IBEAM

final int org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_IBEAM = 1
staticprivate

Definition at line 45 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ SDL_SYSTEM_CURSOR_NO

final int org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_NO = 10
staticprivate

Definition at line 54 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ SDL_SYSTEM_CURSOR_NONE

final int org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_NONE = -1
staticprivate

Definition at line 43 of file SDLActivity.java.

◆ SDL_SYSTEM_CURSOR_SIZEALL

final int org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_SIZEALL = 9
staticprivate

Definition at line 53 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ SDL_SYSTEM_CURSOR_SIZENESW

final int org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_SIZENESW = 6
staticprivate

Definition at line 50 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ SDL_SYSTEM_CURSOR_SIZENS

final int org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_SIZENS = 8
staticprivate

Definition at line 52 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ SDL_SYSTEM_CURSOR_SIZENWSE

final int org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_SIZENWSE = 5
staticprivate

Definition at line 49 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ SDL_SYSTEM_CURSOR_SIZEWE

final int org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_SIZEWE = 7
staticprivate

Definition at line 51 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ SDL_SYSTEM_CURSOR_WAIT

final int org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_WAIT = 2
staticprivate

Definition at line 46 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ SDL_SYSTEM_CURSOR_WAITARROW

final int org.libsdl.app.SDLActivity.SDL_SYSTEM_CURSOR_WAITARROW = 4
staticprivate

Definition at line 48 of file SDLActivity.java.

Referenced by org.libsdl.app.SDLActivity.setSystemCursor().

◆ TAG

final String org.libsdl.app.SDLActivity.TAG = "SDL"
staticprivate

Definition at line 38 of file SDLActivity.java.


The documentation for this class was generated from the following file: