Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

wrap ICodeFormattable and ICSSFormatable in compilertags for prime_cs…

…s library
  • Loading branch information...
commit 6888b97818d90bc97e539e0304e870de3e277c5d 1 parent c47bc98
Ruben Weijers authored
View
5 src/primevc/gui/effects/IEffect.hx
@@ -27,7 +27,7 @@
* Ruben Weijers <ruben @ onlinetouch.nl>
*/
package primevc.gui.effects;
-#if neko
+#if (neko && prime_css)
import primevc.tools.generator.ICodeFormattable;
import primevc.tools.generator.ICSSFormattable;
#end
@@ -43,7 +43,8 @@ package primevc.gui.effects;
interface IEffect
implements IDisposable
, implements IInvalidatable
-#if neko , implements ICSSFormattable
+#if (neko && prime_css)
+ , implements ICSSFormattable
, implements ICodeFormattable #end
, implements IClonable < IEffect >
{
View
5 src/primevc/gui/filters/IBitmapFilter.hx
@@ -27,7 +27,7 @@
* Ruben Weijers <ruben @ onlinetouch.nl>
*/
package primevc.gui.filters;
-#if neko
+#if (neko && prime_css)
import primevc.tools.generator.ICSSFormattable;
import primevc.tools.generator.ICodeFormattable;
#end
@@ -40,7 +40,8 @@ package primevc.gui.filters;
* @creation-date Sep 29, 2010
*/
interface IBitmapFilter
-#if neko implements ICSSFormattable
+#if (neko && prime_css)
+ implements ICSSFormattable
, implements ICodeFormattable #end
{
View
5 src/primevc/gui/graphics/IGraphicElement.hx
@@ -29,7 +29,7 @@
package primevc.gui.graphics;
import primevc.core.traits.IInvalidatable;
import primevc.core.traits.IDisposable;
-#if neko
+#if (neko && prime_css)
import primevc.tools.generator.ICodeFormattable;
import primevc.tools.generator.ICSSFormattable;
#end
@@ -42,7 +42,8 @@ package primevc.gui.graphics;
@:keep interface IGraphicElement //FIXME - no @:keep
implements IInvalidatable
, implements IDisposable
-#if neko , implements ICSSFormattable
+#if (neko && prime_css)
+ , implements ICSSFormattable
, implements ICodeFormattable #end
{
}
View
5 src/primevc/gui/styling/IStyleBlock.hx
@@ -29,7 +29,7 @@
package primevc.gui.styling;
import primevc.core.traits.IFlagOwner;
import primevc.core.traits.IInvalidatable;
-#if neko
+#if (neko && prime_css)
import primevc.tools.generator.ICodeFormattable;
import primevc.tools.generator.ICSSFormattable;
#end
@@ -42,7 +42,8 @@ package primevc.gui.styling;
interface IStyleBlock
implements IInvalidatable
, implements IFlagOwner
-#if neko , implements ICSSFormattable
+#if (neko && prime_css)
+ , implements ICSSFormattable
, implements ICodeFormattable #end
{
/**
View
11 src/primevc/gui/styling/StyleChildren.hx
@@ -29,10 +29,10 @@
package primevc.gui.styling;
import primevc.core.traits.IDisposable;
import Hash;
-#if (neko || debug)
+#if ((neko && prime_css) || debug)
import primevc.utils.ID;
#end
-#if neko
+#if (neko && prime_css)
import primevc.types.SimpleDictionary;
import primevc.tools.generator.ICodeFormattable;
import primevc.tools.generator.ICodeGenerator;
@@ -41,7 +41,7 @@ package primevc.gui.styling;
#end
-typedef SelectorMapType = #if neko SimpleDictionary<String, StyleBlock> #else Hash<StyleBlock> #end;
+typedef SelectorMapType = #if (neko && prime_css) SimpleDictionary<String, StyleBlock> #else Hash<StyleBlock> #end;
/**
* @author Ruben Weijers
@@ -49,7 +49,8 @@ typedef SelectorMapType = #if neko SimpleDictionary<String, StyleBlock> #else Ha
*/
class StyleChildren
implements IDisposable
-#if neko , implements ICSSFormattable
+#if (neko && prime_css)
+ , implements ICSSFormattable
, implements ICodeFormattable #end
{
#if (neko || debug)
@@ -150,7 +151,7 @@ class StyleChildren
}
-#if neko
+#if (neko && prime_css)
public function toString () { return toCSS(); }
View
16 src/primevc/neko/geom/Matrix.hx
@@ -27,9 +27,9 @@
* Ruben Weijers <ruben @ onlinetouch.nl>
*/
package primevc.neko.geom;
- import primevc.utils.ID;
- import primevc.tools.generator.ICodeFormattable;
+#if (prime_css && neko)
import primevc.tools.generator.ICodeGenerator;
+#end
/**
@@ -39,7 +39,7 @@ package primevc.neko.geom;
* @creation-date Sep 14, 2010
* @see http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/geom/Matrix.html
*/
-class Matrix implements ICodeFormattable
+class Matrix #if (prime_css && neko) implements primevc.tools.generator.ICodeFormattable #end
{
public var a : Float;
public var b : Float;
@@ -47,13 +47,15 @@ class Matrix implements ICodeFormattable
public var d : Float;
public var tx : Float;
public var ty : Float;
-
+#if prime_css
public var _oid (default, null) : Int;
-
+#end
public function new (a:Float = 1, b:Float = 0, c:Float = 0, d:Float = 1, tx:Float = 0, ty:Float = 0)
{
- _oid = ID.getNext();
+#if (prime_css && neko)
+ _oid = primevc.utils.ID.getNext();
+#end
this.a = a;
this.b = b;
this.c = c;
@@ -63,7 +65,7 @@ class Matrix implements ICodeFormattable
}
-#if neko
+#if (neko && prime_css)
public function toCode (code:ICodeGenerator) { code.construct( this, [ a, b, c, d, tx, ty ] ); }
public function isEmpty () { return false; }
public function cleanUp () : Void {}
View
2  src/primevc/neko/traits/IHasTypeParameters.hx
@@ -28,7 +28,7 @@
*/
package primevc.neko.traits;
-#if neko
+#if (prime_css && neko)
/**
* Empty interface to indicate in neko that a class has TypeParameters. This is
* needed when generating code and a class with type-parameters is not Generic.
View
37 src/primevc/types/Asset.hx
@@ -46,7 +46,7 @@ package primevc.types;
import primevc.core.net.URLLoader;
import primevc.gui.display.Loader;
-#elseif neko
+#elseif (neko && prime_css)
import primevc.tools.generator.ICodeFormattable;
import primevc.tools.generator.ICodeGenerator;
import primevc.types.Reference;
@@ -69,7 +69,8 @@ private typedef BytesData = haxe.io.BytesData;
*/
class Asset implements IDisposable
, implements IValueObject
-#if neko , implements ICodeFormattable #end
+#if (neko && prime_css)
+ , implements ICodeFormattable #end
{
//
// FACTORY METHODS
@@ -129,10 +130,10 @@ class Asset implements IDisposable
*/
public var bitmapData (default, null) : BitmapData;
-#if neko
+#if (neko && prime_css)
private var source : Dynamic;
#end
-#if (neko || debug)
+#if ((neko && prime_css) || debug)
public var _oid (default, null) : Int;
#end
public var state (default, null) : SimpleStateMachine<AssetStates>;
@@ -142,13 +143,15 @@ class Asset implements IDisposable
- public function new ( #if neko data:Dynamic #end )
+ public function new ( #if (neko && prime_css) data:Dynamic #end )
{
state = new SimpleStateMachine<AssetStates>(empty);
width = height = Number.INT_NOT_SET;
-#if neko source = data; #end
-#if (neko || debug) _oid = primevc.utils.ID.getNext(); #end
-#if flash9 Assert.notNull(type); #end
+#if (neko && prime_css) source = data; #end
+#if flash9 Assert.notNull(type); #end
+#if ((neko && prime_css) || debug)
+ _oid = primevc.utils.ID.getNext();
+#end
}
@@ -156,9 +159,11 @@ class Asset implements IDisposable
{
unsetData();
state.dispose();
- state = null;
-#if neko source = null; #end
-#if (neko || debug) _oid = 0; #end
+ state = null;
+#if (neko && prime_css) source = null; #end
+#if ((neko && prime_css) || debug)
+ _oid = 0;
+#end
}
@@ -201,9 +206,7 @@ class Asset implements IDisposable
bitmapData = new BitmapData( width, height, transparant, fillColor );
bitmapData.draw( display, matrix );
return bitmapData;
-#else
- return null;
-#end
+#else return null; #end
}
@@ -245,14 +248,14 @@ class Asset implements IDisposable
#end
public function load () : Void { Assert.abstract(); }
public function close () : Void { Assert.abstract(); }
-#if neko
+#if (neko && prime_css)
public function isEmpty () : Bool { return source == null; }
#else
public function isEmpty () : Bool { Assert.abstract(); return false; }
#end
-#if neko
+#if (neko && prime_css)
public function cleanUp () : Void {}
public function toCode (code:ICodeGenerator)
{
@@ -267,7 +270,7 @@ class Asset implements IDisposable
}
#end
-#if (neko || debug)
+#if debug
public function toString ()
{
return "."+(state != null ? ""+state.current : "disposed") + " - " + _oid+"; type: "+type;
View
12 src/primevc/types/Factory.hx
@@ -27,7 +27,7 @@
* Ruben Weijers <ruben @ onlinetouch.nl>
*/
package primevc.types;
-#if neko
+#if (neko && prime_css)
import primevc.core.traits.IDisposable;
import primevc.neko.traits.IHasTypeParameters;
@@ -41,7 +41,7 @@ package primevc.types;
using Type;
#end
-#if !neko
+#if (!neko || !prime_css)
typedef Factory<C> = Void -> C;
typedef Factory1<A, C> = A -> C;
#else
@@ -56,9 +56,11 @@ typedef Factory1<A,C> = Factory<C>;
*/
class Factory <InstanceType >
implements IDisposable
-#if neko , implements ICSSFormattable
+#if (neko && prime_css)
+ , implements ICSSFormattable
, implements ICodeFormattable
- , implements IHasTypeParameters #end
+ , implements IHasTypeParameters
+#end
{
public static inline var EMPTY_ARRAY = [];
@@ -106,7 +108,7 @@ class Factory <InstanceType >
}*/
-#if neko
+#if (neko && prime_css)
public function toCSS (prefix:String = "")
{
return cssValue == null ? classRef : cssValue;
View
15 src/primevc/types/SimpleDictionary.hx
@@ -30,15 +30,13 @@ package primevc.types;
import primevc.core.collections.iterators.FastArrayForwardIterator;
import primevc.core.traits.IClonable;
import primevc.core.traits.IDisposable;
-#if neko
+#if (neko && prime_css)
import primevc.tools.generator.ICodeFormattable;
-#end
- import primevc.utils.FastArray;
-#if (neko || debug)
import primevc.tools.generator.ICodeGenerator;
import primevc.utils.ID;
import primevc.utils.TypeUtil;
#end
+ import primevc.utils.FastArray;
using primevc.utils.FastArray;
using Std;
@@ -52,21 +50,22 @@ package primevc.types;
class SimpleDictionary < KType, VType >
implements IDisposable
, implements IClonable<SimpleDictionary<KType, VType>>
-#if !neko , implements haxe.rtti.Generic
+#if (!prime_css && !neko)
+ , implements haxe.rtti.Generic
#else , implements ICodeFormattable #end
{
private var _keys : FastArray < KType >;
private var _values : FastArray < VType >;
public var length (getLength, never) : Int;
-#if (neko || debug)
+#if (prime_css && neko)
public var _oid (default, null) : Int;
#end
public function new (size:Int = 0, fixed:Bool = false)
{
-#if (neko || debug)
+#if (neko && prime_css)
_oid = ID.getNext();
#end
_keys = FastArrayUtil.create(size, fixed);
@@ -164,7 +163,7 @@ class SimpleDictionary < KType, VType >
#end
#end
-#if neko
+#if (neko && prime_css)
public function toHash () : Hash<VType>
{
var hash = new Hash<VType>();
View
10 src/primevc/types/URI.hx
@@ -27,7 +27,7 @@
* Danny Wilson <danny @ onlinetouch.nl>
*/
package primevc.types;
-#if neko
+#if (neko && prime_css)
import primevc.tools.generator.ICodeFormattable;
import primevc.tools.generator.ICodeGenerator;
import primevc.utils.ID;
@@ -56,7 +56,7 @@ package primevc.types;
*
* @author Danny Wilson
*/
-class URI #if neko implements ICodeFormattable #end
+class URI #if (neko && prime_css) implements ICodeFormattable #end
{
#if debug
static function __init__()
@@ -155,14 +155,14 @@ class URI #if neko implements ICodeFormattable #end
( path.notNull() && path.length.not0())
-#if neko
+#if (neko && prime_css)
public var _oid (default, null) : Int;
#end
public function new(str:String = null)
{
-#if neko
+#if (neko && prime_css)
_oid = ID.getNext();
#end
port = -1;
@@ -364,7 +364,7 @@ class URI #if neko implements ICodeFormattable #end
}
-#if neko
+#if (neko && prime_css)
public function cleanUp () : Void {}
public function toCode (code:ICodeGenerator) { code.construct( this, [ getString() ] ); }
#end
Please sign in to comment.
Something went wrong with that request. Please try again.