|
| 1 | +var $ = new function(){ |
| 2 | + /** |
| 3 | + * Inner classes |
| 4 | + **/ |
| 5 | + function Matrix(a,b,c,d,tx,ty){ |
| 6 | + // TODO: http://help.adobe.com/zh_CN/FlashPlatform/reference/actionscript/3/flash/geom/Matrix.html |
| 7 | + var data = [[a,c,tx],[b,d,ty],[0,0,1]]; |
| 8 | + this.clone = function(){ |
| 9 | + return new this(a,b,c,d,tx,ty); |
| 10 | + }; |
| 11 | + this.concat = function(matrix){ |
| 12 | + return; |
| 13 | + }; |
| 14 | + this. |
| 15 | + }; |
| 16 | + |
| 17 | + function SVGShape(){ |
| 18 | + var id = Runtime.generateIdent(); |
| 19 | + }; |
| 20 | + |
| 21 | + function CanvasObject(){ |
| 22 | + var id = Runtime.generateIdent(); |
| 23 | + }; |
| 24 | + |
| 25 | + function ButtonObject(){ |
| 26 | + var id = Runtime.generateIdent(); |
| 27 | + }; |
| 28 | + |
| 29 | + function CommentObject(){ |
| 30 | + var id = Runtime.generateIdent(); |
| 31 | + }; |
| 32 | + |
| 33 | + function FilterObject(){ |
| 34 | + var id = Runtime.generateIdent(); |
| 35 | + }; |
| 36 | + /** |
| 37 | + * Private Variable stubs |
| 38 | + **/ |
| 39 | + var stage = { |
| 40 | + width:-1, |
| 41 | + height:-1, |
| 42 | + fsWidth:-1, |
| 43 | + fsHeight:-1 |
| 44 | + }; |
| 45 | + |
| 46 | + /** |
| 47 | + * Private method stubs |
| 48 | + **/ |
| 49 | + var _fullScreenWidth = function(){ |
| 50 | + return stage.fsWidth; |
| 51 | + }; |
| 52 | + |
| 53 | + var _fullScreenHeight = function(){ |
| 54 | + return stage.fsHeight; |
| 55 | + }; |
| 56 | + |
| 57 | + var _width = function(){ |
| 58 | + return stage.width; |
| 59 | + }; |
| 60 | + |
| 61 | + var _height = function(){ |
| 62 | + return stage.height; |
| 63 | + }; |
| 64 | + |
| 65 | + /** |
| 66 | + * Bind listeners |
| 67 | + **/ |
| 68 | + __schannel("update:dimension", function(dim){ |
| 69 | + stage.width = dim.stageWidth; |
| 70 | + stage.height = dim.stageHeight; |
| 71 | + stage.fsWidth = dim.screenWidth; |
| 72 | + stage.fsHeight = dim.screenHeight; |
| 73 | + }); |
| 74 | + |
| 75 | + |
| 76 | + /** |
| 77 | + * Public method stubs |
| 78 | + **/ |
| 79 | + this.createMatrix = function(){ |
| 80 | + |
| 81 | + }; |
| 82 | + |
| 83 | + this.createPoint = function(x, y){ |
| 84 | + |
| 85 | + }; |
| 86 | + |
| 87 | + this.createComment = function(text, param){ |
| 88 | + |
| 89 | + }; |
| 90 | + |
| 91 | + this.createShape = function(param){ |
| 92 | + |
| 93 | + }; |
| 94 | + |
| 95 | + this.createCanvas = function(param){ |
| 96 | + |
| 97 | + }; |
| 98 | + |
| 99 | + this.createButton = function(param){ |
| 100 | + |
| 101 | + }; |
| 102 | + |
| 103 | + this.createGlowFilter = function(color, alpha, blurX, blurY, strength, quality, inner, knockout){ |
| 104 | + |
| 105 | + }; |
| 106 | + |
| 107 | + this.createBlurFilter = function(blurX, blurY, quality){ |
| 108 | + |
| 109 | + }; |
| 110 | + |
| 111 | + this.toIntVector = function(arr){ |
| 112 | + |
| 113 | + }; |
| 114 | + |
| 115 | + this.toUIntVector = function(arr){ |
| 116 | + |
| 117 | + }; |
| 118 | + |
| 119 | + this.toNumberVector = function(arr){ |
| 120 | + |
| 121 | + }; |
| 122 | + |
| 123 | + this.createVector3D = function(x,y,z,w){ |
| 124 | + |
| 125 | + }; |
| 126 | + |
| 127 | + this.createMatrix3D = function(x,y,z,w){ |
| 128 | + |
| 129 | + }; |
| 130 | + |
| 131 | + this.createColorTransform = function(rM, gM, bM, aM, rO, gO, bO, aO){ |
| 132 | + |
| 133 | + }; |
| 134 | + |
| 135 | + this.createTextFormat = function(font, size, color, bold, italic, underline, url, target, align, leftMargin, rightMargin, indent, leading){ |
| 136 | + |
| 137 | + }; |
| 138 | + |
| 139 | + this.toString = function(){ |
| 140 | + return "[display Display]"; |
| 141 | + }; |
| 142 | + /** |
| 143 | + * Initializer for all the getter/setter fields |
| 144 | + */ |
| 145 | + if(this.__defineGetter__){ |
| 146 | + this.__defineGetter__("fullScreenWidth", function(){ |
| 147 | + return _fullScreenWidth(); |
| 148 | + }); |
| 149 | + this.__defineGetter__("fullScreenHeight", function(){ |
| 150 | + return _fullScreenHeight(); |
| 151 | + }); |
| 152 | + this.__defineGetter__("width", function(){ |
| 153 | + return _width(); |
| 154 | + }); |
| 155 | + this.__defineGetter__("height", function(){ |
| 156 | + return _height(); |
| 157 | + }); |
| 158 | + this.__defineGetter__("version", function(){ |
| 159 | + return "CCLDisplay/1.0 HTML5/* (bilibili, like BSE, like flash)"; |
| 160 | + }); |
| 161 | + } |
| 162 | + |
| 163 | + if(this.__defineSetter__){ |
| 164 | + this.__defineSetter__("fullScreenWidth", function(){ |
| 165 | + __trace("Attempted to assign to read-only field", 'warn'); |
| 166 | + }); |
| 167 | + this.__defineSetter__("fullScreenHeight", function(){ |
| 168 | + __trace("Attempted to assign to read-only field", 'warn'); |
| 169 | + }); |
| 170 | + this.__defineSetter__("width", function(){ |
| 171 | + __trace("Attempted to assign to read-only field", 'warn'); |
| 172 | + }); |
| 173 | + this.__defineSetter__("fullScreenHeight", function(){ |
| 174 | + __trace("Attempted to assign to read-only field", 'warn'); |
| 175 | + }); |
| 176 | + } |
| 177 | +}; |
| 178 | + |
| 179 | +/** Create alias **/ |
| 180 | +var Display = $; |
0 commit comments