commit 02a4ac20048f7c52c78e677e654d0e19c6cb90c6
Author: Leszek Koltunski <leszek@distoretedandroid.org>
Date:   Thu Jun 8 17:00:09 2017 +0100

    Progress with support for Effect classes. Almost compiles now!

diff --git a/src/main/java/org/distorted/library/effect/PostprocessEffectBlur.java b/src/main/java/org/distorted/library/effect/PostprocessEffectBlur.java
index bf81f70..e8fe00f 100644
--- a/src/main/java/org/distorted/library/effect/PostprocessEffectBlur.java
+++ b/src/main/java/org/distorted/library/effect/PostprocessEffectBlur.java
@@ -34,7 +34,12 @@ public class PostprocessEffectBlur extends PostprocessEffect
   private static final boolean SUPPORTS_REGION = false;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-
+/**
+ * Blur the object.
+ *
+ * @param radius The 'strength' if the effect, in pixels. 0 = no blur, 10 = when blurring a given pixel,
+ *               take into account 10 pixels in each direction.
+ */
   public PostprocessEffectBlur(Data1D radius)
     {
     super(BLUR,UNITIES,DIMENSION,SUPPORTS_CENTER,SUPPORTS_REGION,NAME);
diff --git a/src/main/java/org/distorted/library/effect/PostprocessEffectGlow.java b/src/main/java/org/distorted/library/effect/PostprocessEffectGlow.java
index ea47b2e..0be37e4 100644
--- a/src/main/java/org/distorted/library/effect/PostprocessEffectGlow.java
+++ b/src/main/java/org/distorted/library/effect/PostprocessEffectGlow.java
@@ -37,7 +37,13 @@ public class PostprocessEffectGlow extends PostprocessEffect
   private static final boolean SUPPORTS_REGION = false;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-
+/**
+ * Make the object glow with a specific color and a halo of specific radius.
+ *
+ * @param radius The 'strength' if the effect, in pixels. 0 = no halo, 10 = halo of roughly 10 pixels
+ *               around the whole object.
+ * @param color  RGBA of the color with which to draw the glow.
+ */
   public PostprocessEffectGlow(Data1D radius, Data4D color)
     {
     super(GLOW,UNITIES,DIMENSION,SUPPORTS_CENTER,SUPPORTS_REGION,NAME);
diff --git a/src/main/java/org/distorted/library/main/DistortedEffectsPostprocess.java b/src/main/java/org/distorted/library/main/DistortedEffectsPostprocess.java
index 9201c48..460ebd4 100644
--- a/src/main/java/org/distorted/library/main/DistortedEffectsPostprocess.java
+++ b/src/main/java/org/distorted/library/main/DistortedEffectsPostprocess.java
@@ -21,8 +21,6 @@ package org.distorted.library.main;
 
 import org.distorted.library.effect.Effect;
 import org.distorted.library.message.EffectListener;
-import org.distorted.library.type.Data1D;
-import org.distorted.library.type.Data4D;
 
 import java.util.ArrayList;
 
@@ -227,26 +225,25 @@ public class DistortedEffectsPostprocess implements DistortedSlave
     mP.deregisterForMessages(el);
     }
 
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Aborts all Effects.
  * @return Number of effects aborted.
  */
-  @SuppressWarnings("unused")
   public int abortAllEffects()
-      {
-      return mP.abortAll(true);
-      }
+    {
+    return mP.abortAll(true);
+    }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
- * Aborts all Effects of a given type (currently only POSTPROCESSING Effects).
- * 
- * @param type one of the constants defined in {@link org.distorted.library.effect.Effect}
+ * Aborts all Effects of a given type, for example all POSTPROCESS Effects.
+ *
+ * @param type one of the constants defined in {@link Effect}
  * @return Number of effects aborted.
  */
-  @SuppressWarnings("unused")
-  public int abortEffects(int type)
+  public int abortByType(int type)
     {
     switch(type)
       {
@@ -254,57 +251,22 @@ public class DistortedEffectsPostprocess implements DistortedSlave
       default                : return 0;
       }
     }
-    
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Aborts a single Effect.
- * 
- * @param id ID of the Effect we want to abort.
+ *
+ * @param effect the Effect we want to abort.
  * @return number of Effects aborted. Always either 0 or 1.
  */
-  @SuppressWarnings("unused")
-  public int abortEffect(long id)
-    {
-    int type = (int)(id&Effect.MASK);
-
-    if( type==Effect.POSTPROCESS ) return mP.removeByID(id>>Effect.LENGTH);
-
-    return 0;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-/**
- * Abort all Effects of a given name, for example all blurs.
- * 
- * @param name one of the constants defined in {@link org.distorted.library.effect.PostprocessEffect}
- * @return number of Effects aborted.
- */
-  @SuppressWarnings("unused")
-  public int abortEffects(int name)
+  public int abortEffect(Effect effect)
     {
-    switch(name.getType())
+    switch(effect.getType())
       {
-      case POSTPROCESS: return mP.removeByType(name);
-      default         : return 0;
+      case Effect.POSTPROCESS: return mP.removeEffect(effect);
+      default                : return 0;
       }
     }
-    
-///////////////////////////////////////////////////////////////////////////////////////////////////
-/**
- * Print some info about a given Effect to Android's standard out. Used for debugging only.
- * 
- * @param id Effect ID we want to print info about
- * @return <code>true</code> if a single Effect of type effectType has been found.
- */
-  @SuppressWarnings("unused")
-  public boolean printEffect(long id)
-    {
-    int type = (int)(id&EffectTypes.MASK);
-
-    if( type==EffectTypes.POSTPROCESS.type )  return mP.printByID(id>>EffectTypes.LENGTH);
-
-    return false;
-    }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
@@ -315,7 +277,7 @@ public class DistortedEffectsPostprocess implements DistortedSlave
   @SuppressWarnings("unused")
   public static int getMaxPostprocess()
     {
-    return EffectQueue.getMax(EffectTypes.POSTPROCESS.ordinal());
+    return EffectQueue.getMax(Effect.POSTPROCESS);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -337,7 +299,7 @@ public class DistortedEffectsPostprocess implements DistortedSlave
   @SuppressWarnings("unused")
   public static boolean setMaxPostprocess(int max)
     {
-    return EffectQueue.setMax(EffectTypes.POSTPROCESS.ordinal(),max);
+    return EffectQueue.setMax(Effect.POSTPROCESS,max);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -356,35 +318,17 @@ public class DistortedEffectsPostprocess implements DistortedSlave
     DistortedMaster.newSlave(this);
     }
 
-///////////////////////////////////////////////////////////////////////////////////////////////////   
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Individual effect functions.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Postprocess-based effects
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
- * Blur the object.
+ * Add a new Effect to our queue.
  *
- * @param radius The 'strength' if the effect, in pixels. 0 = no blur, 10 = when blurring a given pixel,
- *               take into account 10 pixels in each direction.
- * @return ID of the effect added, or -1 if we failed to add one.
+ * @param effect The Effect to add.
  */
-  public long blur(Data1D radius)
+  public void apply(Effect effect)
     {
-    return mP.add(EffectNames.BLUR, radius);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-/**
- * Make the object glow with a specific color and a halo of specific radius.
- *
- * @param radius The 'strength' if the effect, in pixels. 0 = no halo, 10 = halo of roughly 10 pixels
- *               around the whole object.
- * @param color  RGBA of the color with which to draw the glow.
- * @return ID of the effect added, or -1 if we failed to add one.
- */
-  public long glow(Data1D radius, Data4D color)
-    {
-    return mP.add(EffectNames.GLOW, radius, color);
+    switch(effect.getType())
+      {
+      case Effect.POSTPROCESS : mP.add(effect); break;
+      }
     }
   }
