Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
MasDennis
committed
Jul 7, 2011
0 parents
commit cf42276
Showing
47 changed files
with
4,274 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="src" path="gen"/> | ||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
/bin | ||
/gen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>Rajawali</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>com.android.ide.eclipse.adt.ApkBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.monyetmabuk.livewallpapers.photosdof" | ||
android:versionCode="1" | ||
android:versionName="1.0"> | ||
|
||
|
||
<application android:icon="@drawable/icon" android:label="@string/app_name"> | ||
<service android:name="com.monyetmabuk.livewallpapers.engine.wallpaper.Wallpaper" | ||
android:label="@string/app_name" | ||
android:permission="android.permission.BIND_WALLPAPER"> | ||
<intent-filter> | ||
<action android:name="android.service.wallpaper.WallpaperService" /> | ||
</intent-filter> | ||
<meta-data android:name="android.service.wallpaper" android:resource="@xml/albums" /> | ||
</service> | ||
|
||
<activity | ||
android:label="@string/wallpaper_settings" | ||
android:name="com.monyetmabuk.livewallpapers.engine.wallpaper.WallpaperSettings" | ||
android:exported="true"> | ||
</activity> | ||
</application> | ||
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8"/> | ||
<uses-feature android:glEsVersion="0x00020000"/> | ||
<uses-feature android:name="android.software.live_wallpaper" /> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This file is automatically generated by Android Tools. | ||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED! | ||
# | ||
# This file must be checked in Version Control Systems. | ||
# | ||
# To customize properties used by the Ant build system use, | ||
# "build.properties", and override values to adapt the script to your | ||
# project structure. | ||
|
||
# Project target. | ||
target=android-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
-optimizationpasses 5 | ||
-dontusemixedcaseclassnames | ||
-dontskipnonpubliclibraryclasses | ||
-dontpreverify | ||
-verbose | ||
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* | ||
|
||
-keep public class * extends android.app.Activity | ||
-keep public class * extends android.app.Application | ||
-keep public class * extends android.app.Service | ||
-keep public class * extends android.content.BroadcastReceiver | ||
-keep public class * extends android.content.ContentProvider | ||
-keep public class * extends android.app.backup.BackupAgentHelper | ||
-keep public class * extends android.preference.Preference | ||
-keep public class com.android.vending.licensing.ILicensingService | ||
|
||
-keepclasseswithmembernames class * { | ||
native <methods>; | ||
} | ||
|
||
-keepclasseswithmembernames class * { | ||
public <init>(android.content.Context, android.util.AttributeSet); | ||
} | ||
|
||
-keepclasseswithmembernames class * { | ||
public <init>(android.content.Context, android.util.AttributeSet, int); | ||
} | ||
|
||
-keepclassmembers enum * { | ||
public static **[] values(); | ||
public static ** valueOf(java.lang.String); | ||
} | ||
|
||
-keep class * implements android.os.Parcelable { | ||
public static final android.os.Parcelable$Creator *; | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<integer name="ribbon_default_amplitude">5</integer> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="app_name"></string> | ||
<string name="wallpaper_settings"></string> | ||
<string name="description"></string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<wallpaper xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:thumbnail="@drawable/icon" | ||
android:description="@string/description" | ||
android:settingsActivity="rajawali.wallpaper.WallpaperSettings" | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:title="@string/app_settings" | ||
android:key="appsettings"> | ||
|
||
<PreferenceCategory> | ||
<!-- CheckBoxPreference | ||
android:key="touchAnimation" | ||
android:title="@string/touch_animation_setting" | ||
android:summary="@string/touch_animation_summary" | ||
android:defaultValue="true" /> | ||
</PreferenceCategory> | ||
</PreferenceScreen> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
package net.rbgrn.opengl; | ||
|
||
import javax.microedition.khronos.egl.EGL10; | ||
import javax.microedition.khronos.egl.EGLConfig; | ||
import javax.microedition.khronos.egl.EGLDisplay; | ||
|
||
import android.opengl.GLSurfaceView.EGLConfigChooser; | ||
|
||
abstract class BaseConfigChooser implements EGLConfigChooser { | ||
// =========================================================== | ||
// Constants | ||
// =========================================================== | ||
|
||
// =========================================================== | ||
// Fields | ||
// =========================================================== | ||
|
||
protected int[] mConfigSpec; | ||
|
||
// =========================================================== | ||
// Constructors | ||
// =========================================================== | ||
|
||
public BaseConfigChooser(final int[] configSpec) { | ||
this.mConfigSpec = configSpec; | ||
} | ||
|
||
// =========================================================== | ||
// Getter & Setter | ||
// =========================================================== | ||
|
||
// =========================================================== | ||
// Methods for/from SuperClass/Interfaces | ||
// =========================================================== | ||
|
||
abstract EGLConfig chooseConfig(EGL10 egl, EGLDisplay display, EGLConfig[] configs); | ||
|
||
public EGLConfig chooseConfig(final EGL10 egl, final EGLDisplay display) { | ||
final int[] num_config = new int[1]; | ||
egl.eglChooseConfig(display, this.mConfigSpec, null, 0, num_config); | ||
|
||
final int numConfigs = num_config[0]; | ||
|
||
if (numConfigs <= 0) { | ||
throw new IllegalArgumentException("No configs match configSpec"); | ||
} | ||
|
||
final EGLConfig[] configs = new EGLConfig[numConfigs]; | ||
egl.eglChooseConfig(display, this.mConfigSpec, configs, numConfigs, num_config); | ||
final EGLConfig config = this.chooseConfig(egl, display, configs); | ||
if (config == null) { | ||
throw new IllegalArgumentException("No config chosen"); | ||
} | ||
return config; | ||
} | ||
|
||
// =========================================================== | ||
// Methods | ||
// =========================================================== | ||
|
||
// =========================================================== | ||
// Inner and Anonymous Classes | ||
// =========================================================== | ||
|
||
public static class ComponentSizeChooser extends BaseConfigChooser { | ||
public ComponentSizeChooser(final int redSize, final int greenSize, final int blueSize, final int alphaSize, final int depthSize, final int stencilSize) { | ||
super(new int[] { EGL10.EGL_RED_SIZE, redSize, EGL10.EGL_GREEN_SIZE, greenSize, EGL10.EGL_BLUE_SIZE, blueSize, EGL10.EGL_ALPHA_SIZE, alphaSize, EGL10.EGL_DEPTH_SIZE, depthSize, EGL10.EGL_STENCIL_SIZE, stencilSize, EGL10.EGL_NONE }); | ||
this.mValue = new int[1]; | ||
this.mRedSize = redSize; | ||
this.mGreenSize = greenSize; | ||
this.mBlueSize = blueSize; | ||
this.mAlphaSize = alphaSize; | ||
this.mDepthSize = depthSize; | ||
this.mStencilSize = stencilSize; | ||
} | ||
|
||
@Override | ||
public EGLConfig chooseConfig(final EGL10 egl, final EGLDisplay display, final EGLConfig[] configs) { | ||
EGLConfig closestConfig = null; | ||
int closestDistance = 1000; | ||
for (final EGLConfig config : configs) { | ||
final int d = this.findConfigAttrib(egl, display, config, EGL10.EGL_DEPTH_SIZE, 0); | ||
final int s = this.findConfigAttrib(egl, display, config, EGL10.EGL_STENCIL_SIZE, 0); | ||
if (d >= this.mDepthSize && s >= this.mStencilSize) { | ||
final int r = this.findConfigAttrib(egl, display, config, EGL10.EGL_RED_SIZE, 0); | ||
final int g = this.findConfigAttrib(egl, display, config, EGL10.EGL_GREEN_SIZE, 0); | ||
final int b = this.findConfigAttrib(egl, display, config, EGL10.EGL_BLUE_SIZE, 0); | ||
final int a = this.findConfigAttrib(egl, display, config, EGL10.EGL_ALPHA_SIZE, 0); | ||
final int distance = Math.abs(r - this.mRedSize) + Math.abs(g - this.mGreenSize) + Math.abs(b - this.mBlueSize) + Math.abs(a - this.mAlphaSize); | ||
if (distance < closestDistance) { | ||
closestDistance = distance; | ||
closestConfig = config; | ||
} | ||
} | ||
} | ||
return closestConfig; | ||
} | ||
|
||
private int findConfigAttrib(final EGL10 egl, final EGLDisplay display, final EGLConfig config, final int attribute, final int defaultValue) { | ||
|
||
if (egl.eglGetConfigAttrib(display, config, attribute, this.mValue)) { | ||
return this.mValue[0]; | ||
} | ||
return defaultValue; | ||
} | ||
|
||
private final int[] mValue; | ||
// Subclasses can adjust these values: | ||
protected int mRedSize; | ||
protected int mGreenSize; | ||
protected int mBlueSize; | ||
protected int mAlphaSize; | ||
protected int mDepthSize; | ||
protected int mStencilSize; | ||
} | ||
|
||
/** | ||
* This class will choose a supported surface as close to RGB565 as | ||
* possible, with or without a depth buffer. | ||
* | ||
*/ | ||
public static class SimpleEGLConfigChooser extends ComponentSizeChooser { | ||
public SimpleEGLConfigChooser(final boolean withDepthBuffer) { | ||
super(4, 4, 4, 0, withDepthBuffer ? 16 : 0, 0); | ||
// Adjust target values. This way we'll accept a 4444 or | ||
// 555 buffer if there's no 565 buffer available. | ||
this.mRedSize = 5; | ||
this.mGreenSize = 6; | ||
this.mBlueSize = 5; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package net.rbgrn.opengl; | ||
|
||
import javax.microedition.khronos.egl.EGL10; | ||
import javax.microedition.khronos.egl.EGLConfig; | ||
import javax.microedition.khronos.egl.EGLContext; | ||
import javax.microedition.khronos.egl.EGLDisplay; | ||
|
||
import android.opengl.GLSurfaceView.EGLContextFactory; | ||
|
||
class DefaultContextFactory implements EGLContextFactory { | ||
// =========================================================== | ||
// Constants | ||
// =========================================================== | ||
|
||
// =========================================================== | ||
// Fields | ||
// =========================================================== | ||
|
||
// =========================================================== | ||
// Constructors | ||
// =========================================================== | ||
|
||
// =========================================================== | ||
// Getter & Setter | ||
// =========================================================== | ||
|
||
// =========================================================== | ||
// Methods for/from SuperClass/Interfaces | ||
// =========================================================== | ||
|
||
public EGLContext createContext(final EGL10 egl, final EGLDisplay display, final EGLConfig config) { | ||
return egl.eglCreateContext(display, config, EGL10.EGL_NO_CONTEXT, null); | ||
} | ||
|
||
public void destroyContext(final EGL10 egl, final EGLDisplay display, final EGLContext context) { | ||
egl.eglDestroyContext(display, context); | ||
} | ||
|
||
// =========================================================== | ||
// Methods | ||
// =========================================================== | ||
|
||
// =========================================================== | ||
// Inner and Anonymous Classes | ||
// =========================================================== | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package net.rbgrn.opengl; | ||
|
||
import javax.microedition.khronos.egl.EGL10; | ||
import javax.microedition.khronos.egl.EGLConfig; | ||
import javax.microedition.khronos.egl.EGLDisplay; | ||
import javax.microedition.khronos.egl.EGLSurface; | ||
|
||
import android.opengl.GLSurfaceView.EGLWindowSurfaceFactory; | ||
|
||
class DefaultWindowSurfaceFactory implements EGLWindowSurfaceFactory { | ||
// =========================================================== | ||
// Constants | ||
// =========================================================== | ||
|
||
// =========================================================== | ||
// Fields | ||
// =========================================================== | ||
|
||
// =========================================================== | ||
// Constructors | ||
// =========================================================== | ||
|
||
// =========================================================== | ||
// Getter & Setter | ||
// =========================================================== | ||
|
||
// =========================================================== | ||
// Methods for/from SuperClass/Interfaces | ||
// =========================================================== | ||
|
||
public EGLSurface createWindowSurface(final EGL10 egl, final EGLDisplay display, final EGLConfig config, final Object nativeWindow) { | ||
return egl.eglCreateWindowSurface(display, config, nativeWindow, null); | ||
} | ||
|
||
public void destroySurface(final EGL10 egl, final EGLDisplay display, final EGLSurface surface) { | ||
egl.eglDestroySurface(display, surface); | ||
} | ||
|
||
// =========================================================== | ||
// Methods | ||
// =========================================================== | ||
|
||
// =========================================================== | ||
// Inner and Anonymous Classes | ||
// =========================================================== | ||
} |
Oops, something went wrong.