From http://www.jwz.org/xscreensaver/xscreensaver-5.31.tar.gz
[xscreensaver] / android / project / xscreensaver / src / org / jwz / xscreensaver / gen / StonerviewWallpaper.java
diff --git a/android/project/xscreensaver/src/org/jwz/xscreensaver/gen/StonerviewWallpaper.java b/android/project/xscreensaver/src/org/jwz/xscreensaver/gen/StonerviewWallpaper.java
new file mode 100644 (file)
index 0000000..4d36cc8
--- /dev/null
@@ -0,0 +1,50 @@
+package org.jwz.xscreensaver.gen;
+
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.opengles.GL10;
+
+import net.rbgrn.android.glwallpaperservice.*;
+import android.opengl.GLU;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import org.jwz.xscreensaver.*;
+
+public class StonerviewWallpaper extends ARenderer {
+
+    private static native void nativeSettings(String hack, String hackPref, int draw);
+    public static final String SHARED_PREFS_NAME="stonerviewsettings";
+    CallNative cn;
+
+    public void onSurfaceCreated(GL10 gl, EGLConfig config) {
+
+        super.onSurfaceCreated(gl, config);
+
+        cn = new CallNative();
+        NonSurfaceCreated();
+    }
+
+    public void onDrawFrame(GL10 gl) {
+        super.onDrawFrame(gl);
+        nativeSettings("bogus", "bogus", 1);
+        NonDrawFrame();
+    }
+
+    void NonDrawFrame() {
+        cn.nativeRender();
+    }
+
+    void doSP(SharedPreferences sspp) {
+        String hackPref = sspp.getString("stonerview_speed", "1"); // key
+        String hack = "stonerview";
+        nativeSettings(hack, hackPref, 0);
+    }
+
+
+
+    static
+    {
+        System.loadLibrary ("xscreensaver");
+    }
+
+}