Added javadoc comments to document methods used by JNI.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
diff --git a/android-project/src/org/libsdl/app/SDLActivity.java b/android-project/src/org/libsdl/app/SDLActivity.java
index 6056cde..1c063bb 100644
--- a/android-project/src/org/libsdl/app/SDLActivity.java
+++ b/android-project/src/org/libsdl/app/SDLActivity.java
@@ -297,24 +297,37 @@ public class SDLActivity extends Activity {
int naxes, int nhats, int nballs);
public static native int nativeRemoveJoystick(int device_id);
+ /**
+ * This method is called by SDL using JNI.
+ */
public static void flipBuffers() {
SDLActivity.nativeFlipBuffers();
}
+ /**
+ * This method is called by SDL using JNI.
+ */
public static boolean setActivityTitle(String title) {
// Called from SDLMain() thread and can't directly affect the view
return mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title);
}
+ /**
+ * This method is called by SDL using JNI.
+ */
public static boolean sendMessage(int command, int param) {
return mSingleton.sendCommand(command, Integer.valueOf(param));
}
+ /**
+ * This method is called by SDL using JNI.
+ */
public static Context getContext() {
return mSingleton;
}
/**
+ * This method is called by SDL using JNI.
* @return result of getSystemService(name) but executed on UI thread.
*/
public Object getSystemServiceFromUiThread(final String name) {
@@ -380,16 +393,26 @@ public class SDLActivity extends Activity {
}
}
+ /**
+ * This method is called by SDL using JNI.
+ */
public static boolean showTextInput(int x, int y, int w, int h) {
// Transfer the task to the main thread as a Runnable
return mSingleton.commandHandler.post(new ShowTextInputTask(x, y, w, h));
}
-
+
+ /**
+ * This method is called by SDL using JNI.
+ */
public static Surface getNativeSurface() {
return SDLActivity.mSurface.getNativeSurface();
}
// Audio
+
+ /**
+ * This method is called by SDL using JNI.
+ */
public static int audioInit(int sampleRate, boolean is16Bit, boolean isStereo, int desiredFrames) {
int channelConfig = isStereo ? AudioFormat.CHANNEL_CONFIGURATION_STEREO : AudioFormat.CHANNEL_CONFIGURATION_MONO;
int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
@@ -423,7 +446,10 @@ public class SDLActivity extends Activity {
return 0;
}
-
+
+ /**
+ * This method is called by SDL using JNI.
+ */
public static void audioWriteShortBuffer(short[] buffer) {
for (int i = 0; i < buffer.length; ) {
int result = mAudioTrack.write(buffer, i, buffer.length - i);
@@ -441,7 +467,10 @@ public class SDLActivity extends Activity {
}
}
}
-
+
+ /**
+ * This method is called by SDL using JNI.
+ */
public static void audioWriteByteBuffer(byte[] buffer) {
for (int i = 0; i < buffer.length; ) {
int result = mAudioTrack.write(buffer, i, buffer.length - i);
@@ -460,6 +489,9 @@ public class SDLActivity extends Activity {
}
}
+ /**
+ * This method is called by SDL using JNI.
+ */
public static void audioQuit() {
if (mAudioTrack != null) {
mAudioTrack.stop();
@@ -470,6 +502,7 @@ public class SDLActivity extends Activity {
// Input
/**
+ * This method is called by SDL using JNI.
* @return an array which may be empty but is never null.
*/
public static int[] inputGetInputDeviceIds(int sources) {
@@ -484,12 +517,15 @@ public class SDLActivity extends Activity {
}
return Arrays.copyOf(filtered, used);
}
-
+
// Joystick glue code, just a series of stubs that redirect to the SDLJoystickHandler instance
public static boolean handleJoystickMotionEvent(MotionEvent event) {
return mJoystickHandler.handleMotionEvent(event);
}
-
+
+ /**
+ * This method is called by SDL using JNI.
+ */
public static void pollInputDevices() {
if (SDLActivity.mSDLThread != null) {
mJoystickHandler.pollInputDevices();