diff --git a/build.sh b/build.sh index ef02541d7..4df782022 100755 --- a/build.sh +++ b/build.sh @@ -62,7 +62,7 @@ fi if [ -e project/local.properties ] && \ grep "package `grep AppFullName= AndroidAppSettings.cfg | sed 's/.*=//'`;" project/src/Globals.java > /dev/null 2>&1 && \ [ "`readlink AndroidAppSettings.cfg`" -ot "project/src/Globals.java" ] && \ - [ -z "`find project/java/* project/AndroidManifestTemplate.xml -cnewer project/src/Globals.java`" ] + [ -z "`find project/java/* project/javaSDL2/* project/jni/sdl2/android-project/app/src/main/java/org/libsdl/app/* project/AndroidManifestTemplate.xml -cnewer project/src/Globals.java`" ] then true else diff --git a/changeAppSettings.sh b/changeAppSettings.sh index f861ffed8..dc37f6ad5 100755 --- a/changeAppSettings.sh +++ b/changeAppSettings.sh @@ -882,7 +882,7 @@ cat $ANDROID_MANIFEST_TEMPLATE | \ sed "s/android:screenOrientation=.*/android:screenOrientation=\"$ScreenOrientation1\"/" | \ sed "s^android:versionCode=.*^android:versionCode=\"$AppVersionCode\"^" | \ sed "s^android:versionName=.*^android:versionName=\"$AppVersionName\"^" | \ - sed "s^activity android:name=.*^activity android:name=\"MainActivity\"^" > \ + sed "s^activity android:name=\"SDLActivity\"^activity android:name=\"MainActivity\"^" > \ project/AndroidManifest.xml if [ "$AdmobPublisherId" = "n" -o -z "$AdmobPublisherId" ] ; then $SEDI "/==ADMOB==/ d" project/AndroidManifest.xml @@ -1056,6 +1056,12 @@ $SEDI "s%public static String GooglePlayGameServicesId = .*%public static String $SEDI "s/public static String AppLibraries.*/public static String AppLibraries[] = { $LibrariesToLoad };/" project/src/Globals.java $SEDI "s/public static String AppMainLibraries.*/public static String AppMainLibraries[] = { $MainLibrariesToLoad };/" project/src/Globals.java +if $UsingSdl2; then + # Delete options that reference classes from SDL 1.2 + $SEDI "s/public static SettingsMenu.Menu HiddenMenuOptions .*;//" project/src/Globals.java + $SEDI "s/public static SettingsMenu.Menu FirstStartMenuOptions .*;//" project/src/Globals.java +fi + echo Patching project/jni/Settings.mk echo '# DO NOT EDIT THIS FILE - it is automatically generated, edit file SettingsTemplate.mk' > project/jni/Settings.mk cat project/jni/SettingsTemplate.mk | \ diff --git a/project/java/DataDownloader.java b/project/java/DataDownloader.java index 663f433ea..d777bd681 100644 --- a/project/java/DataDownloader.java +++ b/project/java/DataDownloader.java @@ -177,7 +177,6 @@ class DataDownloader extends Thread { Parent = _Parent; Status = new StatusWriter( _Status, _Parent ); - //Status.setText( "Connecting to " + Globals.DataDownloadUrl ); outFilesDir = Globals.DataDir; DownloadComplete = false; this.start(); @@ -193,7 +192,8 @@ class DataDownloader extends Thread @Override public void run() { - Parent.getVideoLayout().setOnKeyListener(new BackKeyListener(Parent)); + if (Parent.getVideoLayout() != null) + Parent.getVideoLayout().setOnKeyListener(new BackKeyListener(Parent)); String [] downloadFiles = Globals.DataDownloadUrl; int total = 0; @@ -235,7 +235,8 @@ class DataDownloader extends Thread } } DownloadComplete = true; - Parent.getVideoLayout().setOnKeyListener(null); + if (Parent.getVideoLayout() != null) + Parent.getVideoLayout().setOnKeyListener(null); initParent(); } @@ -855,7 +856,7 @@ class DataDownloader extends Thread public MainActivity Parent; public void run() { - Parent.initSDL(); + Parent.downloadFinishedInitSDL(); } } Callback cb = new Callback(); diff --git a/project/java/MainActivity.java b/project/java/MainActivity.java index 59de142e6..7fbb51011 100644 --- a/project/java/MainActivity.java +++ b/project/java/MainActivity.java @@ -43,6 +43,7 @@ import android.widget.RelativeLayout; import android.graphics.drawable.Drawable; import android.graphics.Color; import android.content.res.Configuration; +import android.content.pm.ApplicationInfo; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; @@ -193,7 +194,7 @@ public class MainActivity extends Activity { if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP ) { - ApplicationInfo info = this.getPackageManager().getApplicationInfo(Parent.getPackageName(), 0); + ApplicationInfo info = this.getPackageManager().getApplicationInfo(this.getPackageName(), 0); if( info.splitSourceDirs != null ) { for( String apk: info.splitSourceDirs ) @@ -345,7 +346,7 @@ public class MainActivity extends Activity this.runOnUiThread(cb); } - public void initSDL() + public void downloadFinishedInitSDL() { setScreenOrientation(); updateScreenOrientation(); @@ -590,7 +591,7 @@ public class MainActivity extends Activity downloader.setStatusField(_tv); if( downloader.DownloadComplete ) { - initSDL(); + downloadFinishedInitSDL(); } } } diff --git a/project/java/Mouse.java b/project/java/Mouse.java new file mode 100644 index 000000000..4e586936f --- /dev/null +++ b/project/java/Mouse.java @@ -0,0 +1,56 @@ +/* +Simple DirectMedia Layer +Java source code (C) 2009-2014 Sergii Pylypenko + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +package net.sourceforge.clonekeenplus; + +class Mouse +{ + public static final int LEFT_CLICK_NORMAL = 0; + public static final int LEFT_CLICK_NEAR_CURSOR = 1; + public static final int LEFT_CLICK_WITH_MULTITOUCH = 2; + public static final int LEFT_CLICK_WITH_PRESSURE = 3; + public static final int LEFT_CLICK_WITH_KEY = 4; + public static final int LEFT_CLICK_WITH_TIMEOUT = 5; + public static final int LEFT_CLICK_WITH_TAP = 6; + public static final int LEFT_CLICK_WITH_TAP_OR_TIMEOUT = 7; + + public static final int RIGHT_CLICK_NONE = 0; + public static final int RIGHT_CLICK_WITH_MULTITOUCH = 1; + public static final int RIGHT_CLICK_WITH_PRESSURE = 2; + public static final int RIGHT_CLICK_WITH_KEY = 3; + public static final int RIGHT_CLICK_WITH_TIMEOUT = 4; + + public static final int SDL_FINGER_DOWN = 0; + public static final int SDL_FINGER_UP = 1; + public static final int SDL_FINGER_MOVE = 2; + public static final int SDL_FINGER_HOVER = 3; + + public static final int ZOOM_NONE = 0; + public static final int ZOOM_MAGNIFIER = 1; + + public static final int MOUSE_HW_INPUT_FINGER = 0; + public static final int MOUSE_HW_INPUT_STYLUS = 1; + public static final int MOUSE_HW_INPUT_MOUSE = 2; + + public static final int MAX_HOVER_DISTANCE = 1024; + public static final int HOVER_REDRAW_SCREEN = 1024 * 10; + public static final float MAX_PRESSURE = 1024.0f; +} diff --git a/project/java/Keycodes.java b/project/java/SDL_Keys.java similarity index 98% rename from project/java/Keycodes.java rename to project/java/SDL_Keys.java index 6bfc56024..2cf06fd41 100644 --- a/project/java/Keycodes.java +++ b/project/java/SDL_Keys.java @@ -278,7 +278,7 @@ class SDL_1_2_Keycodes // Autogenerated by hand with a command: // grep 'SDL_SCANCODE_' SDL_scancode.h | sed 's/SDL_SCANCODE_\([a-zA-Z0-9_]\+\).*[=] \([0-9]\+\).*/public static final int SDLK_\1 = \2;/' >> Keycodes.java -class SDL_1_3_Keycodes +class SDL_2_Keycodes { public static final int SDLK_UNKNOWN = 0; public static final int SDLK_A = 4; @@ -519,6 +519,10 @@ class SDL_1_3_Keycodes public static final int SDLK_KBDILLUMUP = 280; public static final int SDLK_EJECT = 281; public static final int SDLK_SLEEP = 282; + public static final int SDLK_APP1 = 283; + public static final int SDLK_APP2 = 284; + public static final int SDLK_AUDIOREWIND = 285; + public static final int SDLK_AUDIOFASTFORWARD = 286; // Mouse buttons can be mapped to on-screen keys public static final int SDLK_MOUSE_LEFT = 500; @@ -558,9 +562,9 @@ class SDL_Keys ArrayList Names = new ArrayList (); ArrayList Values = new ArrayList (); Field [] fields = SDL_1_2_Keycodes.class.getDeclaredFields(); - if( Globals.Using_SDL_1_3 ) + if( Globals.UsingSDL2 ) { - fields = SDL_1_3_Keycodes.class.getDeclaredFields(); + fields = SDL_2_Keycodes.class.getDeclaredFields(); } try { diff --git a/project/java/Settings.java b/project/java/Settings.java index f59f39f8b..61cc6915d 100644 --- a/project/java/Settings.java +++ b/project/java/Settings.java @@ -629,7 +629,7 @@ public class Settings Globals.TouchscreenKeyboardTransparency, Globals.FloatingScreenJoystick ? 1 : 0, Globals.AppTouchscreenKeyboardKeysAmount ); - SetupTouchscreenKeyboardGraphics(p); + DemoGLSurfaceView.SetupTouchscreenKeyboardGraphics(p); for( int i = 0; i < Globals.RemapScreenKbKeycode.length; i++ ) nativeSetKeymapKeyScreenKb(i, SDL_Keys.values[Globals.RemapScreenKbKeycode[i]]); if( Globals.TouchscreenKeyboardSize == Globals.TOUCHSCREEN_KEYBOARD_CUSTOM ) @@ -736,63 +736,6 @@ public class Settings } catch (Exception eeeee) {} } - static byte [] loadRaw(Activity p, int res) - { - byte [] buf = new byte[65536 * 2]; - byte [] a = new byte[1048576 * 5]; // We need 5Mb buffer for Keen theme, and this Java code is inefficient - int written = 0; - try{ - InputStream is = new GZIPInputStream(p.getResources().openRawResource(res)); - int readed = 0; - while( (readed = is.read(buf)) >= 0 ) - { - if( written + readed > a.length ) - { - byte [] b = new byte [written + readed]; - System.arraycopy(a, 0, b, 0, written); - a = b; - } - System.arraycopy(buf, 0, a, written, readed); - written += readed; - } - } catch(Exception e) {}; - byte [] b = new byte [written]; - System.arraycopy(a, 0, b, 0, written); - return b; - } - - static void SetupTouchscreenKeyboardGraphics(Activity p) - { - if( Globals.UseTouchscreenKeyboard ) - { - if(Globals.TouchscreenKeyboardTheme < 0) - Globals.TouchscreenKeyboardTheme = 0; - if(Globals.TouchscreenKeyboardTheme > 9) - Globals.TouchscreenKeyboardTheme = 9; - - if( Globals.TouchscreenKeyboardTheme == 0 ) - nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.ultimatedroid)); - if( Globals.TouchscreenKeyboardTheme == 1 ) - nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.simpletheme)); - if( Globals.TouchscreenKeyboardTheme == 2 ) - nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.sun)); - if( Globals.TouchscreenKeyboardTheme == 3 ) - nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.keen)); - if( Globals.TouchscreenKeyboardTheme == 4 ) - nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.retro)); - if( Globals.TouchscreenKeyboardTheme == 5 ) - nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.gba)); - if( Globals.TouchscreenKeyboardTheme == 6 ) - nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.psx)); - if( Globals.TouchscreenKeyboardTheme == 7 ) - nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.snes)); - if( Globals.TouchscreenKeyboardTheme == 8 ) - nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.dualshock)); - if( Globals.TouchscreenKeyboardTheme == 9 ) - nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.n64)); - } - } - abstract static class SdcardAppPath { public static SdcardAppPath get() @@ -1023,7 +966,7 @@ public class Settings private static native void nativeSetVideoMultithreaded(); private static native void nativeSetVideoForceSoftwareMode(); public static native void nativeSetupScreenKeyboard(int size, int drawsize, int theme, int transparency, int floatingScreenJoystick, int buttonAmount); - private static native void nativeSetupScreenKeyboardButtons(byte[] img); + public static native void nativeSetupScreenKeyboardButtons(byte[] img); private static native void nativeInitKeymap(); private static native int nativeGetKeymapKey(int key); private static native void nativeSetKeymapKey(int javakey, int key); diff --git a/project/java/SettingsMenuMisc.java b/project/java/SettingsMenuMisc.java index 6f6cc5290..d8715fa71 100644 --- a/project/java/SettingsMenuMisc.java +++ b/project/java/SettingsMenuMisc.java @@ -369,7 +369,7 @@ class SettingsMenuMisc extends SettingsMenu defaults = defaults2; } - if(Globals.Using_SDL_1_3) + if(Globals.UsingSDL2) { CharSequence[] items2 = { p.getResources().getString(R.string.mouse_keepaspectratio), diff --git a/project/java/Video.java b/project/java/Video.java index 9834e3dc9..c3e0c8455 100644 --- a/project/java/Video.java +++ b/project/java/Video.java @@ -33,11 +33,13 @@ import javax.microedition.khronos.egl.EGLDisplay; import javax.microedition.khronos.egl.EGLSurface; import java.io.File; +import java.io.InputStream; import java.util.concurrent.locks.ReentrantLock; import java.lang.reflect.Method; import java.util.LinkedList; import java.nio.ByteBuffer; import java.nio.ByteOrder; +import java.util.zip.GZIPInputStream; import android.os.Bundle; import android.os.Build; @@ -69,40 +71,6 @@ import android.hardware.input.InputManager; import android.graphics.Rect; -class Mouse -{ - public static final int LEFT_CLICK_NORMAL = 0; - public static final int LEFT_CLICK_NEAR_CURSOR = 1; - public static final int LEFT_CLICK_WITH_MULTITOUCH = 2; - public static final int LEFT_CLICK_WITH_PRESSURE = 3; - public static final int LEFT_CLICK_WITH_KEY = 4; - public static final int LEFT_CLICK_WITH_TIMEOUT = 5; - public static final int LEFT_CLICK_WITH_TAP = 6; - public static final int LEFT_CLICK_WITH_TAP_OR_TIMEOUT = 7; - - public static final int RIGHT_CLICK_NONE = 0; - public static final int RIGHT_CLICK_WITH_MULTITOUCH = 1; - public static final int RIGHT_CLICK_WITH_PRESSURE = 2; - public static final int RIGHT_CLICK_WITH_KEY = 3; - public static final int RIGHT_CLICK_WITH_TIMEOUT = 4; - - public static final int SDL_FINGER_DOWN = 0; - public static final int SDL_FINGER_UP = 1; - public static final int SDL_FINGER_MOVE = 2; - public static final int SDL_FINGER_HOVER = 3; - - public static final int ZOOM_NONE = 0; - public static final int ZOOM_MAGNIFIER = 1; - - public static final int MOUSE_HW_INPUT_FINGER = 0; - public static final int MOUSE_HW_INPUT_STYLUS = 1; - public static final int MOUSE_HW_INPUT_MOUSE = 2; - - public static final int MAX_HOVER_DISTANCE = 1024; - public static final int HOVER_REDRAW_SCREEN = 1024 * 10; - public static final float MAX_PRESSURE = 1024.0f; -} - abstract class DifferentTouchInput { public abstract void process(final MotionEvent event); @@ -776,7 +744,7 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer if(mGlContextLost) { mGlContextLost = false; - Settings.SetupTouchscreenKeyboardGraphics(context); // Reload on-screen buttons graphics + DemoGLSurfaceView.SetupTouchscreenKeyboardGraphics(context); // Reload on-screen buttons graphics super.SwapBuffers(); } @@ -1256,6 +1224,63 @@ class DemoGLSurfaceView extends GLSurfaceView_SDL { } } + static byte [] loadRaw(Activity p, int res) + { + byte [] buf = new byte[65536 * 2]; + byte [] a = new byte[1048576 * 5]; // We need 5Mb buffer for Keen theme, and this Java code is inefficient + int written = 0; + try{ + InputStream is = new GZIPInputStream(p.getResources().openRawResource(res)); + int readed = 0; + while( (readed = is.read(buf)) >= 0 ) + { + if( written + readed > a.length ) + { + byte [] b = new byte [written + readed]; + System.arraycopy(a, 0, b, 0, written); + a = b; + } + System.arraycopy(buf, 0, a, written, readed); + written += readed; + } + } catch(Exception e) {}; + byte [] b = new byte [written]; + System.arraycopy(a, 0, b, 0, written); + return b; + } + + static void SetupTouchscreenKeyboardGraphics(Activity p) + { + if( Globals.UseTouchscreenKeyboard ) + { + if(Globals.TouchscreenKeyboardTheme < 0) + Globals.TouchscreenKeyboardTheme = 0; + if(Globals.TouchscreenKeyboardTheme > 9) + Globals.TouchscreenKeyboardTheme = 9; + + if( Globals.TouchscreenKeyboardTheme == 0 ) + Settings.nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.ultimatedroid)); + if( Globals.TouchscreenKeyboardTheme == 1 ) + Settings.nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.simpletheme)); + if( Globals.TouchscreenKeyboardTheme == 2 ) + Settings.nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.sun)); + if( Globals.TouchscreenKeyboardTheme == 3 ) + Settings.nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.keen)); + if( Globals.TouchscreenKeyboardTheme == 4 ) + Settings.nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.retro)); + if( Globals.TouchscreenKeyboardTheme == 5 ) + Settings.nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.gba)); + if( Globals.TouchscreenKeyboardTheme == 6 ) + Settings.nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.psx)); + if( Globals.TouchscreenKeyboardTheme == 7 ) + Settings.nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.snes)); + if( Globals.TouchscreenKeyboardTheme == 8 ) + Settings.nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.dualshock)); + if( Globals.TouchscreenKeyboardTheme == 9 ) + Settings.nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.n64)); + } + } + DemoRenderer mRenderer; MainActivity mParent; diff --git a/project/javaSDL2/DataDownloader.java b/project/javaSDL2/DataDownloader.java new file mode 120000 index 000000000..57fc3ae98 --- /dev/null +++ b/project/javaSDL2/DataDownloader.java @@ -0,0 +1 @@ +../java/DataDownloader.java \ No newline at end of file diff --git a/project/javaSDL2/MainActivity.java b/project/javaSDL2/MainActivity.java index 61d33b0eb..1e8a60b61 100644 --- a/project/javaSDL2/MainActivity.java +++ b/project/javaSDL2/MainActivity.java @@ -22,11 +22,21 @@ freely, subject to the following restrictions: package net.sourceforge.clonekeenplus; import android.app.Activity; +import android.app.UiModeManager; +import android.content.Context; +import android.content.res.Configuration; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.util.Log; +import android.widget.FrameLayout; import java.util.ArrayList; public class MainActivity extends org.libsdl.app.SDLActivity { @Override protected void onCreate(Bundle savedInstanceState) { + this.instance = this; super.onCreate(savedInstanceState); Globals.DataDir = this.getFilesDir().getAbsolutePath(); @@ -37,7 +47,7 @@ public class MainActivity extends org.libsdl.app.SDLActivity { { if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP ) { - ApplicationInfo info = this.getPackageManager().getApplicationInfo(Parent.getPackageName(), 0); + ApplicationInfo info = this.getPackageManager().getApplicationInfo(this.getPackageName(), 0); if( info.splitSourceDirs != null ) { for( String apk: info.splitSourceDirs ) @@ -60,6 +70,17 @@ public class MainActivity extends org.libsdl.app.SDLActivity { Settings.setEnvVars(this); } + public void downloadFinishedInitSDL() { + // TODO: implement this + } + + @Override + protected void resumeNativeThread() { + Log.i("SDL", "Intercepted resumeNativeThread() from MainActivity"); + super.resumeNativeThread(); + } + + @Override protected String[] getLibraries() { ArrayList ret = new ArrayList(); @@ -71,7 +92,7 @@ public class MainActivity extends org.libsdl.app.SDLActivity { @Override protected String[] getArguments() { - return new String[0]; + return Globals.CommandLine.split(" "); } private static String GetMappedLibraryName(final String s) { @@ -82,6 +103,41 @@ public class MainActivity extends org.libsdl.app.SDLActivity { return s; } + public int getApplicationVersion() { + try { + PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0); + return packageInfo.versionCode; + } catch (PackageManager.NameNotFoundException e) { + Log.i("SDL", "libSDL: Cannot get the version of our own package: " + e); + } + return 0; + } + + public boolean isRunningOnOUYA() { + try { + PackageInfo packageInfo = getPackageManager().getPackageInfo("tv.ouya", 0); + return true; + } catch (PackageManager.NameNotFoundException e) { + } + UiModeManager uiModeManager = (UiModeManager) getSystemService(UI_MODE_SERVICE); + return (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) || Globals.OuyaEmulation; + } + + public static void setScreenOrientation() { + // For compatibility with SDL 1.2 code + } + + public static void setUpStatusLabel() { + // For compatibility with SDL 1.2 code + } + + public static FrameLayout getVideoLayout() { + // For compatibility with SDL 1.2 code + return null; + } + + public static MainActivity instance = null; public String ObbMountPath = null; // Deprecated, always empty public String assetPackPath = null; // Not saved to the config file + public boolean readExternalStoragePermissionDialogAnswered = false; // Deprecated, always false } diff --git a/project/javaSDL2/Mouse.java b/project/javaSDL2/Mouse.java new file mode 120000 index 000000000..5411aa390 --- /dev/null +++ b/project/javaSDL2/Mouse.java @@ -0,0 +1 @@ +../java/Mouse.java \ No newline at end of file diff --git a/project/javaSDL2/SDL_Keys.java b/project/javaSDL2/SDL_Keys.java new file mode 120000 index 000000000..c43ac821a --- /dev/null +++ b/project/javaSDL2/SDL_Keys.java @@ -0,0 +1 @@ +../java/SDL_Keys.java \ No newline at end of file diff --git a/project/javaSDL2/Stubs.java b/project/javaSDL2/Stubs.java new file mode 100644 index 000000000..05027ec18 --- /dev/null +++ b/project/javaSDL2/Stubs.java @@ -0,0 +1,48 @@ +/* +Simple DirectMedia Layer +Java source code (C) 2009-2014 Sergii Pylypenko + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +package net.sourceforge.clonekeenplus; + +import android.app.Activity; +import android.os.Bundle; + +// Stubs for compatibility with SDL 1.2 code + +class SettingsMenu { + public static void showConfig(final MainActivity p, final boolean firstStart) { + } +} + +class RestartMainActivity extends Activity { + // For compatibility with SDL 1.2 code + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + public static final String ACTIVITY_AUTODETECT_SCREEN_ORIENTATION = "libsdl.org.ACTIVITY_AUTODETECT_SCREEN_ORIENTATION"; + public static final String SDL_RESTART_PARAMS = "SDL_RESTART_PARAMS"; +} + +class DemoGLSurfaceView { + static void SetupTouchscreenKeyboardGraphics(Activity p) { + } +} diff --git a/project/javaSDL2/XZInputStream.java b/project/javaSDL2/XZInputStream.java new file mode 120000 index 000000000..8c14f27c3 --- /dev/null +++ b/project/javaSDL2/XZInputStream.java @@ -0,0 +1 @@ +../java/XZInputStream.java \ No newline at end of file