abcdump now supports flag --decompress-only for converting SWC to SWF

Diff is noisy due to trailing whitespace cleanup

--- utils/abcdump.as
+++ utils/abcdump.as
@@ -44,7 +44,7 @@
     import avmplus.File

     include "abc-constants.as"
-
+
     var usage = [
     "Displays the contents of abc or swf files",
     "",
@@ -67,11 +67,12 @@
     " -abs Print the bytecode, but no information about the ABC",
     " -api Print the public API exposed by this abc/swf",
     " -mdversions Use in conjunction with -api when the abc/swf uses old-style versioning",
-    " -pools Print out the contents of the constant pools"
+    " -pools Print out the contents of the constant pools",
+    " --decompress-only Write out a decompressed version of the swc and exit"
     ].join("\n");

     const TAB = "  "
-
+
     var totalSize:int
     var opSizes:Array = new Array(256)

@@ -84,24 +85,24 @@
         if (doExtractInfo)
             print((doExtractAbs ? "// " : "") + s)
     }
-
+
     function toStringNull(x) {
         return (x == null) ? "<null>" : x.toString()
     }
-
+
     // keep track of old-style versioning metadata in a global stack
     var currentVersionMetadata:Array = new Array()
     var apiVersionNames:Array = ["9", "air1", "10", "air1.5", "air1.5.1",
                               "10.0.32", "air1.5.2", "10.1", "air2",
                               "fpsys", "airsys"]
-
+
     function getVersionMetadata():Array {
         if (currentVersionMetadata.length > 0)
             return currentVersionMetadata[currentVersionMetadata.length - 1]
-
+
         return []
     }
-
+
     function pushVersionMetadata(md:Array):Boolean {
         if(md == null)
             return false
@@ -122,12 +123,12 @@
         }
         return false
     }
-
+
     function popVersionMetadata(cond:Boolean):void {
         if(cond)
             currentVersionMetadata.pop()
     }
-
+
     class ABCNamespace
     {
         public var kind:int
@@ -138,13 +139,13 @@
             kind = k
             uri = ns == null ? null : stripVersioningChars(ns)
         }
-
+
         public function clone():ABCNamespace {
             var ns:ABCNamespace = new ABCNamespace(uri, kind)
             ns.apiVersions = apiVersions.concat()
             return ns
         }
-
+
         function stripVersioningChars(s:String) {
             var c:int = s.charCodeAt(s.length-1)
             if(c > 0xE000) {
@@ -154,32 +155,32 @@
             }
             return s
         }
-
+
         public function toString(useMD:Boolean = false):String {
             var vers:Array = useMD ? getVersionMetadata() : apiVersions
             return (uri == null ? "" : uri) + (vers.length > 0 && doDumpAPI ? ("[api: " + vers.join(',') + "]") : "") // + ("(" + constantKinds[kind] + ")")
         }
-
+
         public function isHidden():Boolean {
             return (kind == CONSTANT_PrivateNs || kind == CONSTANT_PackageInternalNs)
         }
     }
-
+
     class QualifiedName
     {
         public var ns:ABCNamespace
         public var localname:String
-
+
         public function QualifiedName(n:ABCNamespace, ln:String) {
             ns = n
             localname = ln
         }
-
+
         public function toString(useMD:Boolean = false):String {
             var nsstr = (ns == null ? "" : ns.toString(useMD))
             return (nsstr == "" ? "" : nsstr + "::") + localname
         }
-
+
         public function isHidden():Boolean {
             return ns.isHidden()
         }
@@ -194,7 +195,7 @@
             this.nsset = nsset
             this.name = name
         }
-
+
         public function toString(useMD:Boolean = false)
         {
             if (nsset.length == 1)
@@ -202,7 +203,7 @@
             else
                 return '{' + joinNsset(nsset, useMD) + '}::' + toStringNull(name)
         }
-
+
         function joinNsset(nsset:Array, useMD:Boolean):String {
             var s:String = ""
             for each (var ns:ABCNamespace in nsset) {
@@ -210,14 +211,14 @@
             }
             return s
         }
-
+
         public function isHidden():Boolean {
             for each(var ns in nsset)
                 if (ns.isHidden())
                     return true
             return false
         }
-
+
         public static function createMultiname(nsset:Array, name:String, flatten:Boolean) {
             if(flatten) {
                 var cur:ABCNamespace = nsset[0].clone()
@@ -232,14 +233,14 @@
                         break
                     }
                 }
-
+
                 if(cur)
                     return new QualifiedName(cur, name)
             }
             return new Multiname(nsset, name)
         }
     }
-
+
     class TypeName
     {
         var name;
@@ -249,7 +250,7 @@
             this.name = name;
             this.types = types;
         }
-
+
         public function toString()
         {
             var s : String = name.toString();
@@ -260,28 +261,28 @@
             return s;
         }
     }
-
+
     class Tuple
     {
         public var key:String
         public var value:String
-
+
         function Tuple(k:String, v:String) {
             key = k
             value = v
         }
-
+
         public function toString() {
             return key + "=" + value
         }
     }
-
+
     class MetaData
     {
         public var name:String
         public var tuples:Vector.<Tuple> = new Vector.<Tuple>()
-
-        public function toString():String
+
+        public function toString():String
         {
             var last:String
             var s:String = last = '['+name+'('
@@ -289,12 +290,12 @@
                 s = (last = s + t.key + "=" + '"' + t.value + '"') + ','
                 return last + ')]'
                 }
-
+
         public function addPair(k:String, v:String) {
             tuples.push(new Tuple(k, v))
         }
     }
-
+
     class MemberInfo
     {
         var id:int
@@ -322,7 +323,7 @@
         var type
         var name
     }
-
+
     class MethodInfo extends MemberInfo
     {
         var method_id:int
@@ -345,7 +346,7 @@
         {
             return format()
         }
-
+
         public function format():String
         {
             var name = this.name ? (this.name is String ? this.name : this.name.toString(useMetadataVersions)) : "function"
@@ -357,7 +358,7 @@
         {
             if(doDumpAPI && name && (name is String || name.isHidden()))
                 return;
-
+
             dumped = true
             dumpPrint("")

@@ -365,13 +366,13 @@
                 for each (var md in metadata)
                     dumpPrint(indent+md)
             }
-
+
             var mdpushed:Boolean = pushVersionMetadata(metadata)

             var s:String = ""
             if (flags & NATIVE && !doDumpAPI)
                 s = "native "
-            s += traitKinds[kind] + " "
+            s += traitKinds[kind] + " "

             dumpPrint(indent+attr+s+format())
             if (code && !doDumpAPI)
@@ -389,7 +390,7 @@
                           " max_stack=" + max_stack +
                           " framesize=" + (local_count + max_scope + max_stack) +
                           " code_len=" + code.length +
-                          " code_offset=" + code_offset)
+                          " code_offset=" + code_offset)
                 code.position = 0
                 var labels:LabelInfo = new LabelInfo()
                 while (code.bytesAvailable > 0)
@@ -406,7 +407,7 @@

                     s += opNames[opcode]
                     s += opNames[opcode].length < 8 ? "\t\t" : "\t"
-
+
                     switch(opcode)
                     {
                         case OP_debugfile:
@@ -427,19 +428,19 @@
                         case OP_pushdouble:
                             s += abc.doubles[readU32()]
                             break;
-                        case OP_getsuper:
-                        case OP_setsuper:
-                        case OP_getproperty:
-                        case OP_initproperty:
-                        case OP_setproperty:
-                        case OP_getlex:
-                        case OP_findpropstrict:
+                        case OP_getsuper:
+                        case OP_setsuper:
+                        case OP_getproperty:
+                        case OP_initproperty:
+                        case OP_setproperty:
+                        case OP_getlex:
+                        case OP_findpropstrict:
                         case OP_findproperty:
                         case OP_finddef:
-                        case OP_deleteproperty:
-                        case OP_istype:
-                        case OP_coerce:
-                        case OP_astype:
+                        case OP_deleteproperty:
+                        case OP_istype:
+                        case OP_coerce:
+                        case OP_astype:
                         case OP_getdescendants:
                             s += abc.names[readU32()]
                             break;
@@ -461,7 +462,7 @@
                             s += abc.methods[readU32()]
                             s += " (" + readU32() + ")"
                             break;
-                        case OP_newclass:
+                        case OP_newclass:
                             s += abc.instances[readU32()]
                             break;
                         case OP_lookupswitch:
@@ -509,7 +510,7 @@
                             s += readU32()
                             break
                         case OP_debug:
-                            s += code.readUnsignedByte()
+                            s += code.readUnsignedByte()
                             s += " " + readU32()
                             s += " " + code.readUnsignedByte()
                             s += " " + readU32()
@@ -549,10 +550,10 @@
                 }
                 dumpPrint(oldindent+"}\n")
             }
-
+
             popVersionMetadata(mdpushed)
         }
-
+
         function readU32():int
         {
             var result:int = code.readUnsignedByte();
@@ -569,7 +570,7 @@
                 return result;
             return   result & 0x0fffffff | code.readUnsignedByte()<<28;
         }
-
+
         function readS24():int
         {
             var b:int = code.readUnsignedByte()
@@ -578,24 +579,24 @@
             return b
         }
     }
-
+
     class SlotInfo extends MemberInfo
     {
         var type
         var value
         public function format():String
         {
-            return traitKinds[kind] + " " + name.toString(useMetadataVersions) + ":" + type +
-                (value !== undefined ? (" = " + (value is String ? ('"'+value+'"') : value)) : "") +
+            return traitKinds[kind] + " " + name.toString(useMetadataVersions) + ":" + type +
+                (value !== undefined ? (" = " + (value is String ? ('"'+value+'"') : value)) : "") +
                 (doDumpAPI ? "" : "\t/* slot_id " + id + " */")
         }
         function dump(abc:Abc, indent:String, attr:String="")
         {
             if(doDumpAPI && name.isHidden())
                 return
-
+
             var mdpushed:Boolean = pushVersionMetadata(metadata)
-
+
             if (kind == TRAIT_Const || kind == TRAIT_Slot)
             {
                 if (metadata && !doDumpAPI) {
@@ -606,7 +607,7 @@
                 popVersionMetadata(mdpushed)
                 return
             }
-
+
             // else, class
             var ct:Traits = value
             var it:Traits = ct.itraits
@@ -625,13 +626,13 @@
                 if (it.flags & CLASS_FLAG_final)
                     def = "final " + def;
             }
-
+
             dumpPrint(indent+attr+def+" "+name.toString(useMetadataVersions)+" extends "+it.base)
             var oldindent = indent
             indent += TAB
             if (it.interfaces.length > 0)
                 dumpPrint(indent+"implements "+it.interfaces)
-
+
             if(doDumpAPI) {
                 var prefix:String = indent+attr+def+" "+name.toString(useMetadataVersions)+" "
                 it.init.dump(abc,prefix)
@@ -646,11 +647,11 @@
                 ct.init.dump(abc,indent,"static ")
                 dumpPrint(oldindent+"}\n")
             }
-
+
             popVersionMetadata(mdpushed)
         }
     }
-
+
     class Traits
     {
         var name
@@ -664,12 +665,12 @@
         const slots:Array = []
         const methods:Array = []
         const members:Array = []
-
+
         public function toString():String
         {
             return String(name)
         }
-
+
         public function dump(abc:Abc, indent:String, attr:String="")
         {
             for each (var m in members)
@@ -680,10 +681,10 @@
     class Abc
     {
         private var data:ByteArray
-
+
         var major:int
         var minor:int
-
+
         var ints:Array
         var uints:Array
         var doubles:Array
@@ -691,20 +692,20 @@
         var namespaces:Array
         var nssets:Array
         var names:Array
-
+
         var defaults:Array = new Array(constantKinds.length)
-
+
         var methods:Array
         var instances:Array
         var classes:Array
         var scripts:Array
         var metadata:Array
-
+
         var publicNs = new ABCNamespace("")
         var anyNs = new ABCNamespace("*")

         var magic:int
-
+
         function Abc(data:ByteArray)
         {
             data.position = 0
@@ -715,9 +716,9 @@

             if (magic != (46<<16|14) && magic != (46<<16|15) && magic != (46<<16|16))
                 throw new Error("not an abc file.  magic=" + magic.toString(16))
-
+
             parseCpool()
-
+
             defaults[CONSTANT_Utf8] = strings
             defaults[CONSTANT_Int] = ints
             defaults[CONSTANT_UInt] = uints
@@ -732,8 +733,8 @@
             defaults[CONSTANT_ProtectedNs] = namespaces
             defaults[CONSTANT_StaticProtectedNs] = namespaces
             defaults[CONSTANT_StaticProtectedNs2] = namespaces
-            defaults[CONSTANT_Null] = { 12: null }
-
+            defaults[CONSTANT_Null] = { 12: null }
+
             parseMethodInfos()
             parseMetadataInfos()
             parseInstanceInfos()
@@ -744,7 +745,7 @@
             if (doExtractAbc==true)
                 File.writeByteArray(nextAbcFname(), data);
         }
-
+
         function readU32():int
         {
             var result:int = data.readUnsignedByte();
@@ -761,23 +762,23 @@
                 return result;
             return   result & 0x0fffffff | data.readUnsignedByte()<<28;
         }
-
+
         function dumpPool(name:String, pool:Array)
         {
             if(!doDumpPools)
                 return
-
+
             for(var i:int = 0; i<pool.length; i++)
                 infoPrint(name + "[" + i + "] = " + pool[i])
         }
-
+
         function padString(s:String, l:uint)
         {
             if(s.length < l)
                 return padString(s + " ", l)
             return s
         }
-
+
         function parseCpool()
         {
             var i:int, j:int
@@ -785,21 +786,21 @@
             var kind:int

             var start:int = data.position
-
+
             // ints
             n = readU32()
             ints = [0]
             for (i=1; i < n; i++)
                 ints[i] = readU32()
             dumpPool("int", ints)
-
+
             // uints
             n = readU32()
             uints = [0]
             for (i=1; i < n; i++)
                 uints[i] = uint(readU32())
             dumpPool("uint", uints)
-
+
             // doubles
             n = readU32()
             doubles = [NaN]
@@ -809,7 +810,7 @@

             infoPrint("Cpool numbers size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
             start = data.position
-
+
             // strings
             n = readU32()
             strings = [""]
@@ -819,7 +820,7 @@

             infoPrint("Cpool strings count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
             start = data.position
-
+
             // namespaces
             n = readU32()
             namespaces = [publicNs]
@@ -848,7 +849,7 @@

             infoPrint("Cpool namespaces count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
             start = data.position
-
+
             // namespace sets
             n = readU32()
             nssets = [null]
@@ -868,7 +869,7 @@

             infoPrint("Cpool nssets count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
             start = data.position
-
+
             // multinames
             n = readU32()
             names = [null]
@@ -882,22 +883,22 @@
                 case CONSTANT_QnameA:
                     names[i] = new QualifiedName(namespaces[readU32()], strings[readU32()])
                     break;
-
+
                 case CONSTANT_RTQname:
                 case CONSTANT_RTQnameA:
                     names[i] = new QualifiedName(null, strings[readU32()])
                     break;
-
+
                 case CONSTANT_RTQnameL:
                 case CONSTANT_RTQnameLA:
                     names[i] = null
                     break;
-
+
                 case CONSTANT_NameL:
                 case CONSTANT_NameLA:
                     names[i] = new QualifiedName(publicNs, null)
                     break;
-
+
                 case CONSTANT_Multiname:
                 case CONSTANT_MultinameA:
                     var name = strings[readU32()]
@@ -908,7 +909,7 @@
                 case CONSTANT_MultinameLA:
                     names[i] = Multiname.createMultiname(nssets[readU32()], null, doDumpAPI)
                     break;
-
+
                 case CONSTANT_TypeName:
                     var name = names[readU32()];
                     var count = readU32();
@@ -917,7 +918,7 @@
                         types.push(names[readU32()]);
                     names[i] = new TypeName(name, types);
                     break;
-
+
                 default:
                     throw new Error("invalid kind " + data[data.position-1])
                 }
@@ -931,7 +932,7 @@
             namespaces[0] = publicNs
             strings[0] = "*"
         }
-
+
         function parseMethodInfos()
         {
             var start:int = data.position
@@ -998,15 +999,15 @@
                 var names:Array = []
                 var keys:Array = []
                 var values:Array = []
-
+
                 for(var q:int = 0; q < values_count; ++q)
                     keys[q] = strings[readU32()]
                 for(var q:int = 0; q < values_count; ++q)
                     values[q] = strings[readU32()]
-
+
                 for(var q:int = 0; q < values_count; ++q)
                     m.addPair(keys[q], values[q])
-
+
                 if(doDumpPools)
                     infoPrint("metadata[" + i + "] = {" + m.tuples.join(", ") + "}")
             }
@@ -1037,7 +1038,7 @@
             }
             infoPrint("InstanceInfo count " + count + " size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
         }
-
+
         function parseTraits(t:Traits)
         {
             var namecount = readU32()
@@ -1081,7 +1082,7 @@
                 member.kind = kind
                 member.name = name
                 t.names[String(name)] = t.members[i] = member
-
+
                 if ( (tag >> 4) & ATTR_metadata ) {
                     member.metadata = []
                     for(var j:int=0, mdCount:int=readU32(); j < mdCount; ++j)
@@ -1105,7 +1106,7 @@
                 t.init.name = t.itraits.name + "$cinit"
                 t.init.kind = TRAIT_Method
                 parseTraits(t)
-            }
+            }
             infoPrint("ClassInfo count " + count + " size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+"%")
         }

@@ -1122,7 +1123,7 @@
                 t.base = names[0] // Object
                 t.init = methods[readU32()]
                 t.init.name = t.name + "$init"
-                t.init.kind = TRAIT_Method
+                t.init.kind = TRAIT_Method
                 parseTraits(t)
             }
             infoPrint("ScriptInfo size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
@@ -1168,7 +1169,7 @@
             }
             infoPrint("MethodBodies count " + count + " size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
         }
-
+
         function dump(indent:String="")
         {
             for each (var t in scripts)
@@ -1205,7 +1206,7 @@
             }
         }
     }
-
+
     class Rect
     {
         var nBits:int
@@ -1216,7 +1217,7 @@
             return "[Rect "+xMin+" "+yMin+" "+xMax+" "+yMax+"]"
         }
     }
-
+
     const stagDoABC                 :int = 72;   // embedded .abc (AVM+) bytecode
     const stagSymbolClass           :int = 76;
     const stagMetadata              :int = 77;
@@ -1340,13 +1341,13 @@
         "DefineBitsJPEG64",     // 90
         "DefineFont4",          // 91
     ]
-
-
+
+
     class Swf
     {
         private var bitPos:int
         private var bitBuf:int
-
+
         private var data:ByteArray

         function Swf(data:ByteArray)
@@ -1355,18 +1356,30 @@
             infoPrint("size "+decodeRect())
             infoPrint("frame rate "+(data.readUnsignedByte()<<8|data.readUnsignedByte()))
             infoPrint("frame count "+data.readUnsignedShort())
-            decodeTags()
-        }
-
+            decodeTags()
+        }
+
+        static function emitSwf(fn:String,data:ByteArray,version:uint)
+        {
+            var ba:ByteArray = new ByteArray
+            ba.endian = "littleEndian"
+            ba.writeByte(0x46); ba.writeByte(0x57); ba.writeByte(0x53); // FWS
+            ba.writeByte(version>>24)
+            ba.writeUnsignedInt(data.length+8)
+            ba.writeBytes(data,0,data.length)
+            File.writeByteArray(fn+".swf",ba)
+            infoPrint("wrote "+ba.length+" bytes to file "+fn+".swf")
+        }
+
         private function decodeTags()
         {
             var type:int, h:int, length:int
             var offset:int
-
+
             while (data.position < data.length)
             {
                 type = (h = data.readUnsignedShort()) >> 6;
-
+
                 if (((length = h & 0x3F) == 0x3F))
                     length = data.readInt();

@@ -1390,7 +1403,7 @@
                     data.readBytes(data2,0,length)
                     new Abc(data2).dump("  ")
                     infoPrint("")
-                    break
+                    break
                 case stagMetadata:
                     infoPrint(new XML(readString()));
                     break;
@@ -1410,27 +1423,27 @@

             return s
         }
-
-        private function syncBits()
+
+        private function syncBits()
         {
             bitPos = 0
         }
-
+
         private function decodeRect():Rect
         {
             syncBits();
-
+
             var rect:Rect = new Rect();
-
+
             var nBits:int = readUBits(5)
             rect.xMin = readSBits(nBits);
             rect.xMax = readSBits(nBits);
             rect.yMin = readSBits(nBits);
             rect.yMax = readSBits(nBits);
-
+
             return rect;
         }
-
+
         function readSBits(numBits:int):int
         {
             if (numBits > 32)
@@ -1442,21 +1455,21 @@
             num = (num << shift) >> shift;
             return num;
         }
-
+
         function readUBits(numBits:int):uint
         {
             if (numBits == 0)
                 return 0
-
+
             var bitsLeft:int = numBits;
             var result:int = 0;
-
+
             if (bitPos == 0) //no value in the buffer - read a byte
             {
                 bitBuf = data.readUnsignedByte()
                 bitPos = 8;
             }
-
+
             while (true)
             {
                 var shift:int = bitsLeft - bitPos;
@@ -1465,7 +1478,7 @@
                     // Consume the entire buffer
                     result |= bitBuf << shift;
                     bitsLeft -= bitPos;
-
+
                     // Get the next byte from the input stream
                     bitBuf = data.readUnsignedByte();
                     bitPos = 8;
@@ -1476,12 +1489,12 @@
                     result |= bitBuf >> -shift;
                     bitPos -= bitsLeft;
                     bitBuf &= 0xff >> (8 - bitPos); // mask off the consumed bits
-
+
     //                if (print) System.out.println("  read"+numBits+" " + result);
                     return result;
                 }
             }
-
+
             // unreachable, but fixes a spurious compiler warning
             return result;
         }
@@ -1503,20 +1516,22 @@
             // suppress abs output
             doExtractAbs = false;
         } else if (arg == '-abs') {
-            // suppress info output
+            // suppress info output
             doExtractInfo = false
-        } else if (arg == '-api') {
+        } else if (arg == '-api') {
             doDumpAPI = true;
             doExtractInfo = false
         } else if (arg == '-mdversions') {
             useMetadataVersions = true
         } else if (arg == '-pools') {
             doDumpPools = true
+        } else if (arg == '--decompress-only') {
+            doDecompressOnly = true
         } else {
             print('Unknown option '+arg)
             help()
         }
-    }
+    }

     function nextAbcFname():String
     {
@@ -1525,25 +1540,26 @@
             s = s.concat(currentFcount);
         currentFcount++
         return s+'.abc'
-    }
-
+    }
+
     // main
     var doExtractAbc = false
     var doExtractInfo = true
     var doExtractAbs = true
     var doDumpAPI = false
     var doDumpPools = false
+    var doDecompressOnly = false
     var useMetadataVersions = false
     var currentFname = ''
     var currentFcount = 0
     for each (var file in System.argv)
     {
-        if (file.indexOf('-')==0)
+        if (file.indexOf('-')==0)
         {
             processArg(file)
             continue
         }
-
+
         var x;
         if ((x = file.lastIndexOf(".swf")) != -1 || (x = file.lastIndexOf(".swc")) != -1)
             currentFname = file.substring(0,x);
@@ -1571,6 +1587,10 @@
             var csize:int = udata.length
             udata.uncompress()
             infoPrint("decompressed swf "+csize+" -> "+udata.length)
+            if (doDecompressOnly) {
+               Swf.emitSwf(file,udata,version)
+               System.exit(0)
+            }
             udata.position = 0
             /*var swf:Swf =*/ new Swf(udata)
             break
@@ -1581,11 +1601,13 @@
         case 70|87<<8|83<<16|6<<24: // SWF6
         case 70|87<<8|83<<16|5<<24: // SWF5
         case 70|87<<8|83<<16|4<<24: // SWF4
+            if (doDecompressOnly)
+               System.exit(0)
             data.position = 8 // skip header and length
             /*var swf:Swf =*/ new Swf(data)
             break
         default:
-            print('unknown format '+version)
+            print('unknown format 0x'+version.toString(16))
             break
         }
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 18259
Author:   deeptika@adobe.com
Date:     2010-10-21T09:02:19.811454Z

Log Message:
-----------
Automation support for item-editing, column resize and header clicks in spark DG
(New xml should be taken from changelist 290001 in perforce)

QE notes:
Doc notes:
Bugs:
Reviewer:
Tests run:
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/tabularData/SparkDataGridTabularData.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/skins/spark/SparkUITextFieldGridItemRendererAutomationImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/manifest_automation_spark.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkComboBoxAutomationImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/AutomationSparkClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/skins/spark/SparkDefaultGridHeaderRendererAutomationImpl.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/gridClasses</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/SparkRichEditableTextAutomationHelper.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkDropDownListBaseAutomationImpl.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/gridClasses/SparkGridItemRendererAutomationImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkDataGridAutomationImpl.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1252324 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/automation_spark/src/spark/automation/delegates/skins/spark/SparkDefaultGridHeaderRendererAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/skins/spark/SparkDefaultGridHeaderRendererAutomationImpl.as
@@ -0,0 +1,147 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+package spark.automation.delegates.skins.spark
+{
+	import flash.display.DisplayObject;
+
+	import mx.automation.Automation;
+	import mx.automation.IAutomationObject;
+	import mx.core.UIComponent;
+	import mx.core.mx_internal;
+
+	import spark.automation.delegates.components.SparkGroupAutomationImpl;
+	import spark.automation.delegates.components.gridClasses.SparkGridItemRendererAutomationImpl;
+	import spark.skins.spark.DefaultGridHeaderRenderer;
+
+	use namespace mx_internal;
+
+	[Mixin]
+	/**
+	 *
+	 *  Defines methods and properties required to perform instrumentation for the
+	 *  ItemRenderer class for spark.
+	 *
+	 *  @see spark.skins.spark.DefaultItemRenderer
+	 *
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 4
+	 */
+	public class SparkDefaultGridHeaderRendererAutomationImpl extends SparkGridItemRendererAutomationImpl
+	{
+		include "../../../../core/Version.as";
+
+		//--------------------------------------------------------------------------
+		//
+		//  Class methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Registers the delegate class for a component class with automation manager.
+		 *
+		 *  @param root The SystemManger of the application.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static function init(root:DisplayObject):void
+		{
+			Automation.registerDelegateClass(spark.skins.spark.DefaultGridHeaderRenderer, SparkDefaultGridHeaderRendererAutomationImpl);
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Constructor.
+		 * @param obj DefaultGridHeaderRenderer object to be automated.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.0
+		 *  @productversion Flex 4.5
+		 */
+		public function SparkDefaultGridHeaderRendererAutomationImpl(obj:DefaultGridHeaderRenderer)
+		{
+			super(obj);
+			recordClick = false;
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Variables
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  @private
+		 *  storage for the owner component
+		 */
+		protected function get gridItem():spark.skins.spark.DefaultGridHeaderRenderer
+		{
+			return uiComponent as spark.skins.spark.DefaultGridHeaderRenderer;
+		}
+
+
+		//--------------------------------------------------------------------------
+		//
+		//  Overridden properties
+		//
+		//--------------------------------------------------------------------------
+
+		//----------------------------------
+		//  automationName
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get automationName():String
+		{
+			return gridItem.label|| super.automationName;
+		}
+
+		//----------------------------------
+		//  automationValue
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get automationValue():Array
+		{
+			return [automationName];
+		}
+
+		override public function getAutomationChildAt(index:int):IAutomationObject
+		{
+			return null;
+		}
+
+		override public function get numAutomationChildren():int
+		{
+			return 0;
+		}
+
+		override public function getAutomationChildren():Array
+		{
+			return [];
+		}
+	}
+}


Fixing logging with multiple items in format string.

--- driver/src/main/flex/org/postgresql/log/Log.as
+++ driver/src/main/flex/org/postgresql/log/Log.as
@@ -96,7 +96,7 @@
         doLog(level, message, rest);
     }
     private function doLog(level:int, message:String, rest:Array):void {
-        var result:String = message.replace(/{(\d+)}/, function():String {
+        var result:String = message.replace(/{(\d+)}/g, function():String {
             var idx:int = int(arguments[1]);
             if (idx > rest.length || idx < 0) {
                 throw new ArgumentError("Invalid log argument index: " + idx);


*** empty log message ***

*** empty log message ***

--- test/ecma3/Unicode/unicodeUtil.as
+++ test/ecma3/Unicode/unicodeUtil.as
@@ -216,7 +216,7 @@
 	} // for

 	this.array[this.item++] = new TestCase(SECTION,
-            "Unicode Split on Mark", '', stringReplaceResult);
+            "Unicode Split on Mark", '', testSplitResult);

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1260428 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/effects/effectClasses/IrisInstance.as
+++ frameworks/projects/framework/src/mx/effects/effectClasses/IrisInstance.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////

 package mx.effects.effectClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 16236
Author:   jszeto@adobe.com
Date:     2010-05-20T00:54:54.963159Z

Log Message:
-----------
Form Feature Work

Merging in Form classes from the private sandbox. All spec'ed functionality has been implemented.

QE notes: none
Doc notes: Needs ASDoc comments
Bugs: none
Reviewer: Hans, Kevin
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/SparkClasses.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/layouts/FormItemLayout.as" copyfrom-rev="15875" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/FormItemLayout.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/assets/ErrorIndicator.png" copyfrom-rev="16235" action="R">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/assets/ErrorIndicator.png</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutElementHelper.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/layouts/ConstraintLayout.as" copyfrom-rev="15875" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/ConstraintLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/StackedFormItemSkin.mxml" copyfrom-rev="15875" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/StackedFormItemSkin.mxml</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/Form.as" copyfrom-rev="15875" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Form.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/FormItemSkin.mxml" copyfrom-rev="15875" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/FormItemSkin.mxml</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/StackedFormHeadingSkin.mxml" copyfrom-rev="16047" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/StackedFormHeadingSkin.mxml</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/FormHeadingSkin.mxml" copyfrom-rev="15875" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/FormHeadingSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/layouts/FormLayout.as" copyfrom-rev="15875" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/FormLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/bundles/en_US/layout.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/assets/RequiredIndicator.png" copyfrom-rev="16235" action="R">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/assets/RequiredIndicator.png</path>
<path kind="dir" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/assets" copyfrom-rev="16235" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/assets</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/FormItem.as" copyfrom-rev="15875" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/FormItem.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/FormHeading.as" copyfrom-rev="15875" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/FormHeading.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/FormSkin.mxml" copyfrom-rev="15875" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/FormSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/FocusSkin.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1282191 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
@@ -304,6 +304,8 @@
     //  baselinePosition
     //----------------------------------

+    [Bindable ("baselinePositionChanged")]
+
     /**
      *  @inheritDoc
      *
@@ -326,8 +328,20 @@
         // is vertically centered.
         // At the crossover height, these two calculations
         // produce the same result.
-
-        return FTETextUtil.calculateFontBaseline(this, height, moduleFactory);
+
+        var bElement:IVisualElement = baselinePositionElement;
+
+        if (bElement == null && numElements > 0)
+        {
+            bElement = getElementAt(0);
+        }
+
+        if (bElement)
+            return bElement.baselinePosition + bElement.y;
+        else
+            return NaN;
+
+        //return FTETextUtil.calculateFontBaseline(this, height, moduleFactory);
     }

     //----------------------------------
@@ -396,6 +410,40 @@
     //
     //--------------------------------------------------------------------------

+    //----------------------------------
+    //  baselinePositionElement
+    //----------------------------------
+
+    private var _baselinePositionElement:IVisualElement;
+
+    /**
+     *  The element used to calculate the GroupBase's baselinePosition
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get baselinePositionElement():IVisualElement
+    {
+        return _baselinePositionElement;
+    }
+
+    /**
+     *  @private
+     */
+    public function set baselinePositionElement(value:IVisualElement):void
+    {
+        if (value === _baselinePositionElement)
+            return;
+
+        _baselinePositionElement = value;
+        invalidateSize();
+        invalidateDisplayList();
+        // TODO (jszeto) Figure out what to invalidate. We want the parent to remeasure
+    }
+
+
     //----------------------------------
     //  layout
     //----------------------------------


Transferred from the Adobe Open Source Subversion Repository

Revision: 3925
Author:   jimurphy@adobe.com
Date:     2008-10-28T15:28:25.006190Z

Log Message:
-----------
Merged gumbo_alpha revisions 3857-3860,3870,3872,3874-3876,3881,3884,3886,3889,3891,3893,3895,3908,3912 -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/effects/examples/FxRotateEffectExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/TransformOffsets.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/effects/examples/FxFadeEffectExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/CubicBezierSegment.as</path>
<path kind="file" copyfrom-path="/flex/sdk/branches/gumbo_alpha/frameworks/projects/flex4/src/mx/skins/spark/FxFocusSkin.as" copyfrom-rev="3895" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxFocusSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/FxVSliderExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/LineSegment.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StylesContainer.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxFadeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxFade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/FxListExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/effects/examples/FxMoveEffectExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/PathSegment.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/CompoundTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout_conversion.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/effects/examples/FxAnimateColorEffectExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout_core.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/effects/examples/FxAnimateEffectExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/FxCheckBoxExample.mxml</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxNumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" copyfrom-path="/flex/sdk/branches/gumbo_alpha/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/DataGroupExample.mxml" copyfrom-rev="3895" action="A">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/DataGroupExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimateColor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flash/css/StyleDeclaration.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButton.as</path>
<path kind="file" copyfrom-path="/flex/sdk/branches/gumbo_alpha/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/GroupExample.mxml" copyfrom-rev="3895" action="A">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/GroupExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxSpinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/QuadraticBezierSegment.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/FxNumericStepperExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/effects/examples/FxResizeEffectExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxRotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/Flex4Classes.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/FxButtonExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxResizeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxResize.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/FxToggleButtonExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/FxSpinnerExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/PropertyValuesHolder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxMoveInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout_edit.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/TextViewExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxMove.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleModule.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/FxHSliderExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/utils/MatrixUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleDef.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/AdvancedLayoutFeatures.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1284366 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/effects/supportClasses/FadeInstance.as
+++ frameworks/projects/spark/src/spark/effects/supportClasses/FadeInstance.as
@@ -17,10 +17,8 @@
 import mx.effects.Animation;
 import mx.effects.PropertyValuesHolder;
 import mx.events.AnimationEvent;
+import mx.events.FlexEvent;
 import mx.graphics.graphicsClasses.GraphicElement;
-
-import mx.effects.effectClasses.PropertyChanges;
-import mx.events.FlexEvent;
 import mx.managers.LayoutManager;

 public class FxFadeInstance extends FxAnimateInstance
@@ -71,7 +69,7 @@
      *  where 0.0 means transparent and 1.0 means fully opaque.
      */
     public var alphaTo:Number;
-
+
     /**
      *  @private
      */
@@ -79,8 +77,6 @@
     {
         // Remember the original value of the target object's alpha
         origAlpha = target.alpha;
-        var revalidate:Boolean = false;
-
         var propChanges:PropertyChanges = propertyChanges;

         // If nobody assigned a value, make this a "show" effect.
@@ -103,6 +99,8 @@
                 alphaFrom = propChanges.start["parent"] ? origAlpha : 0;
                 alphaTo = propChanges.end["parent"] ? origAlpha : 0;
                 restoreAlpha = true;
+                if (alphaFrom == 0)
+                    target.alpha = 0;
             }
             else if (propChanges && propChanges.end["elementHost"] !== undefined)
             {
@@ -169,11 +167,11 @@
      *  be visible (or not) or removed (or not).
      *  @private
      */
-    override protected function endHandler(event:AnimationEvent):void
+    override public function finishEffect():void
     {
         // Call super function first so we don't clobber resetting the alpha.
-        super.endHandler(event);
-
+        super.finishEffect();
+
         if (restoreAlpha)
             target.alpha = origAlpha;


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1286481 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as
+++ frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as
@@ -1,4 +1,18 @@
-
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+// Warning: the implementation of this class is identical to UITextFieldGridItemRenderer.
+// Although most of the common code has been factored into the "IUITextFieldGridItemRenderer.as"
+// include file, the imports metadata and other code below have been copied.  All changes
+// to this file should be mirrored by TextFieldGridItemRendererInclude.as.

 package spark.skins.spark
 {


Fix opening already-open projects

Fix opening already-open projects

--- exporter/src/main/as/flump/export/FlumpApp.as
+++ exporter/src/main/as/flump/export/FlumpApp.as
@@ -58,13 +58,8 @@
     public function openProject (configFile :File = null) :void {
         // This project may already be open.
         for each (var ctrl :ProjectController in _projects) {
-            if (ctrl.configFile == configFile) {
-                ctrl.win.visible = false;
-                if (!ctrl.win.orderToFront()) {
-                    ctrl.win.restore();
-                    ctrl.win.orderToFront();
-                }
-
+            if (ctrl.configFile != null && ctrl.configFile.nativePath == configFile.nativePath) {
+                ctrl.win.activate();
                 return;
             }
         }


Change cow circle radii

Change cow circle radii

This changes cow circle radii from being proportional to the number of
cows in a square to being proportional to the square root of the
number of cows in a square.  Since the circle area is proportional to
the square of the radius, this makes the area of circles proportional
to the number of cows, instead of the square of the number of cows.

--- src/battlecode/client/viewer/render/DrawMap.as
+++ src/battlecode/client/viewer/render/DrawMap.as
@@ -150,7 +150,7 @@
                     var color:Number = Team.cowColor(Team.valueOf(cowsTeams[i][j]));
                     this.neutralCanvas.graphics.lineStyle(1, color, 0.8);
                     this.neutralCanvas.graphics.beginFill(color, 0.4);
-                    this.neutralCanvas.graphics.drawCircle((i + .5) * g, (j + .5) * g, g * density / 2);
+                    this.neutralCanvas.graphics.drawCircle((i + .5) * g, (j + .5) * g, g * Math.sqrt(density) / 2);
                     this.neutralCanvas.graphics.endFill();
                 }
             }


Use ClassUtil.isSameClass().

Use ClassUtil.isSameClass().

git-svn-id: a3e1eb16dde062992de22c830ed8045c8013209a@40 c613c5cb-e716-0410-b11b-feb51c14d237

--- src/as/com/threerings/parlor/game/data/GameConfig.as
+++ src/as/com/threerings/parlor/game/data/GameConfig.as
@@ -133,7 +133,7 @@
     public function equals (other :Object) :Boolean
     {
         // make sure they're of the same class
-        if (ClassUtil.getClassName(other) == ClassUtil.getClassName(this)) {
+        if (ClassUtil.isSameClass(other, this)) {
             var that :GameConfig = GameConfig(other);
             return this.rated == that.rated;


replace URL class by core.uri

replace URL class by core.uri

--- src/com/google/analytics/campaign/CampaignManager.as
+++ src/com/google/analytics/campaign/CampaignManager.as
@@ -24,10 +24,10 @@
     import com.google.analytics.core.OrganicReferrer;
     import com.google.analytics.debug.DebugConfiguration;
     import com.google.analytics.debug.VisualDebugMode;
-    import com.google.analytics.utils.Protocols;
-    import com.google.analytics.utils.URL;
     import com.google.analytics.utils.Variables;
     import com.google.analytics.v4.Configuration;
+
+    import core.uri;

     /**
      * The CampaignManager class.
@@ -81,39 +81,32 @@
                 return true;
             }

-            if( referrer.indexOf("://") > -1 )
-            {
-                var url:URL = new URL( referrer );
-
-                if( (url.protocol == Protocols.file) ||
-                    (url.protocol == Protocols.none) )
-                    {
+            var url:uri = new uri( referrer );
+
+            if( (url.scheme == "file") ||
+                (url.scheme == "") )
+            {
+                return true;
+            }
+
+            return false;
+        }
+
+        /**
+         * Checks if the document referrer is from the google custom search engine.
+         * @private
+         * @return true if the referrer is from google custom search engine.
+         */
+        public static function isFromGoogleCSE( referrer:String, config:Configuration ):Boolean
+        {
+            var url:uri = new uri( referrer );
+
+            if( url.host.indexOf( config.google ) > -1 )
+            {
+                if( (url.path == "/"+config.googleCsePath ) &&
+                    (url.query.indexOf( config.googleSearchParam+"=" ) > -1) )
+                {
                     return true;
-                    }
-            }
-
-            return false;
-        }
-
-        /**
-         * Checks if the document referrer is from the google custom search engine.
-         * @private
-         * @return true if the referrer is from google custom search engine.
-         */
-        public static function isFromGoogleCSE( referrer:String, config:Configuration ):Boolean
-        {
-            var url:URL = new URL( referrer );
-
-            // verify that the referrer is google cse search query.
-            if( url.hostName.indexOf( config.google ) > -1 )
-            {
-                if( url.search.indexOf( config.googleSearchParam+"=" ) > -1 )
-                {
-                    // check if this is google custom search engine.
-                    if( url.path == "/"+config.googleCsePath )
-                    {
-                        return true;
-                    }
                 }
             }

@@ -288,27 +281,21 @@
                 return camp;
             }

-            var ref:URL = new URL( _referrer );
-            var name:String = "";
-
-            if( ref.hostName != "" )
-            {
-                if( ref.hostName.indexOf( "." ) > -1 )
-                {
-                    var tmp:Array = ref.hostName.split( "." );
+            var ref:uri = new uri( _referrer );
+            var name:String;
+
+            if( (ref.host != "") && (ref.host.indexOf(".") > -1) )
+            {
+                var tmp:Array = ref.host.split( "." );
+
+                switch( tmp.length )
+                {
+                    case 2:
+                    name = tmp[0];
+                    break;

-                    switch( tmp.length)
-                    {
-                        case 2:
-                        // case: http://domain.com
-                        name = tmp[0];
-                        break;
-
-                        case 3:
-                        //case: http://www.domain.com
-                        name = tmp[1];
-                        break;
-                    }
+                    case 3:
+                    name = tmp[1];
                 }
             }

@@ -318,7 +305,7 @@
                 var currentOrganicSource:OrganicReferrer = _config.organic.getReferrerByName( name );

                 // extract keyword value from query string
-                var keyword:String = _config.organic.getKeywordValue( currentOrganicSource, ref.search );
+                var keyword:String = _config.organic.getKeywordValue( currentOrganicSource, ref.query );

                 camp = new CampaignTracker();
                 camp.source = currentOrganicSource.engine;
@@ -349,9 +336,11 @@
             }

             // get host name from referrer
-            var ref:URL = new URL( _referrer );
-            var hostname:String = ref.hostName;
+            var ref:uri = new uri( _referrer );
+            var hostname:String = ref.host;
             var content:String  = ref.path;
+
+            if( content == "" ) { content = "/"; } //fix empty path

             if( hostname.indexOf( "www." ) == 0 )
             {


added optional interfaces param to Weave.registerClass()

--- WeaveJS/src/Weave.as
+++ WeaveJS/src/Weave.as
@@ -444,7 +444,7 @@
 		/**
 		 * Registers a class for use with Weave.className() and Weave.getDefinition().
 		 */
-		public static function registerClass(name:String, definition:Class):void
+		public static function registerClass(name:String, definition:Class, additionalInterfaces:Array = null):void
 		{
 			map_name_class.set(name, definition);
 			map_class_name.set(definition, name);
@@ -458,6 +458,9 @@
 					names: [{ name: shortName, qName: name}],
 					interfaces: [weavejs.api.core.ILinkableObject]
 				};
+
+			for each (var item:Class in additionalInterfaces)
+				definition.prototype.FLEXJS_CLASS_INFO.interfaces.push(item);
 		}

 		/**


Fixed save/load

Fixed save/load

--- src/Testing/Instructions/LoadInstruction.as
+++ src/Testing/Instructions/LoadInstruction.as
@@ -16,14 +16,14 @@
 		}

 		override public function execute(memory:Dictionary, registers:Dictionary):int {
-			if (isNaN( memory[registers[args[1].value]]))
+			if (isNaN( memory[registers[args[2].value]]))
 				throw new Error("!!!");
-			registers[args[0].value] = memory[registers[args[1].value]];
+			registers[args[0].value] = memory[registers[args[2].value]];
 			return C.INT_NULL;
 		}

 		override public function toMemValue():InstructionValue {
-			return new InstructionValue(OpcodeValue.OP_LD, C.INT_NULL, args[1].value, args[0].value);
+			return new InstructionValue(OpcodeValue.OP_LD, C.INT_NULL, args[2].value, args[0].value);
 		}

 	}


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1248440 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/advancedgrids/src/mx/collections/IGroupingCollection.as
+++ frameworks/projects/advancedgrids/src/mx/collections/IGroupingCollection.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 Adobe Systems Incorporated
-//  All Rights Reserved.
-//
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
-//
-////////////////////////////////////////////////////////////////////////////////

 package mx.collections
 {


ZoomBounds.setSessionState now sets useCenterCoords.
removed temporary "return null"

Change-Id: Ia49d6ef17e32c0c0ef5f7c1a5cc87531ba971a2f

--- WeaveData/src/weave/primitives/ZoomBounds.as
+++ WeaveData/src/weave/primitives/ZoomBounds.as
@@ -56,7 +56,6 @@
 		 */
 		public function getSessionState():Object
 		{
-			return null;
 			if (_useCenterCoords)
 			{
 				return {
@@ -135,6 +134,8 @@
 						}
 					}
 				}
+
+				_useCenterCoords = usedCenterCoords;
 			}

 			cc.resumeCallbacks();


Update TrivialDrive.as

Update TrivialDrive.as

added local save of gas level

--- project_templates/pure_as3/src/TrivialDrive.as
+++ project_templates/pure_as3/src/TrivialDrive.as
@@ -107,6 +107,11 @@
             _gauge.setTo(_gasLevel);
         }

+        // Read gas level from local storage
+        var sharedObj:SharedObject = SharedObject.getLocal("saveData");
+        _gasLevel = sharedObj.data.gasLevel;
+        _gauge.setTo(_gasLevel);
+
         // Remove wait assets
         removeChild(_waitBackground);
         removeChild(_waitIcon);
@@ -122,12 +127,24 @@
         if (_gasLevel >= 0) // _gasLevel = -1 means infinite gas (subscribed user)
             _gasLevel++;
         _gauge.setTo(_gasLevel);
+
+        // save gas level locally
+        saveGasLevel();
     }

     protected function drive(event:MouseEvent):void {
         if (_gasLevel > 0)
             _gasLevel--;
         _gauge.setTo(_gasLevel);
+
+        // save gas level locally
+        saveGasLevel();
+    }
+
+    private function saveGasLevel():void {
+        var sharedObj:SharedObject = SharedObject.getLocal("saveData");
+        sharedObj.data.gasLevel = _gasLevel;
+        sharedObj.flush();
     }

     protected function upgrade(event:MouseEvent):void {


detect is macos

detect is macos

--- actionscript/src/com/freshplanet/ane/AirPushNotification/PushNotification.as
+++ actionscript/src/com/freshplanet/ane/AirPushNotification/PushNotification.as
@@ -47,7 +47,7 @@
          *
          */
         public static function get isSupported():Boolean {
-            return _isIOS() || _isAndroid();
+            return _isIOS() || _isAndroid() || _isMacOS();
         }

         /**
@@ -137,7 +137,7 @@

 			if (_isAndroid())
                 callContext("registerPush", projectId);
-			else if(_isIOS())
+			else if(_isIOS() || _isMacOS())
 				callContext("registerPush", iOSNotificationCategories != null ? JSON.stringify(iOSNotificationCategories) : null);
 		}

@@ -244,7 +244,7 @@

 		public function checkAppNotificationSettingsRequest():void {

-			if (_isIOS()) {
+			if (_isIOS() || _isMacOS()) {
 				callContext("checkAppNotificationSettingsRequest");
 			}
 		}
@@ -341,6 +341,14 @@

         /**
          *
+         * @return  true if MacOS
+         */
+        private static function _isMacOS():Boolean {
+			return Capabilities.os.indexOf("Mac OS") > -1;
+        }
+
+        /**
+         *
          * @param e
          */
         private function _onStatus(e:StatusEvent):void {


Transferred from the Adobe Open Source Subversion Repository

Revision: 8131
Author:   chaase@adobe.com
Date:     2009-06-23T23:08:25.193334Z

Log Message:
-----------
Fix for 2 gumbo_priority bugs. One was a miscalculation of a Parallel effect's duration when it had zero-duration child effects, causing a problem when seeking into that parallel effect. The other was a fix to the easing model for transform effects. Now a transform effect will handle easing through its internal keyframes, preserving the behavior specified by the caller (or by the default easing behavior).

QE Notes: None. Behavior for AnimateTransform should be as before, although the way easing is applied to the subclasses has changed (and is now correct)
Doc Notes: None
Bugs: sdk-21477, sdk-21422
Reviewer: Jason
Tests: checkintests, Mustella spark/effects

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Move3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Rotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Scale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Rotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Move.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Scale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/ParallelInstance.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1283623 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/effects/Move.as
+++ frameworks/projects/spark/src/spark/effects/Move.as
@@ -82,6 +82,7 @@
     {
         super(target);
         instanceClass = AnimateTransformInstance;
+        transformEffectSubclass = true;
     }


Make FilterTerm [RemoteClass] to enable clone() to work

--- as3/xobjas3/src/com/rpath/xobj/FilterTerm.as
+++ as3/xobjas3/src/com/rpath/xobj/FilterTerm.as
@@ -14,6 +14,7 @@
 package com.rpath.xobj
 {

+[RemoteClass]
 [Bindable]
 public class FilterTerm
 {


Fix XSS in sAS3Cam.swf by checking if callTarget is a valid JS identifier

--- sAS3Cam.as
+++ sAS3Cam.as
@@ -148,7 +148,14 @@

         private function extCall(func:String):Boolean {
             var target:String = this.loaderInfo.parameters["callTarget"];
-            return ExternalInterface.call(target + "." + func);
+
+            // Check if callTarget is a valid JS identifier
+            var jsIdentifierRegex:RegExp = /^[$A-Z_][0-9A-Z_$]*$/;
+            if (jsIdentifierRegex.test(target)) {
+                return ExternalInterface.call(target + "." + func);
+            }
+
+            return ExternalInterface.call("alert", "Invalid callTarget: it must be a valid JS identifier.");
         }

         private function isContainerReady():Boolean {
@@ -212,4 +219,4 @@
             return string;
         }
     }
-}+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1269107 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/controls/treeClasses/HierarchicalViewCursor.as
+++ frameworks/projects/mx/src/mx/controls/treeClasses/HierarchicalViewCursor.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////

 package mx.controls.treeClasses
 {


Fix possible double dispatch of terminated

--- runtime/src/main/as/flump/executor/Executor.as
+++ runtime/src/main/as/flump/executor/Executor.as
@@ -44,10 +44,13 @@
             }
         }
         if (!removed) throw new Error("Unknown future completed? " + f);
+        // Only dispatch terminated if it was set when this future completed. If it's set as
+        // part of this dispatch, it'll dispatch in the shutdown call
+        const wasShutdown :Boolean = _shutdown
         completed.dispatch(f);

         runIfAvailable();
-        if (_running.length == 0 && _shutdown) terminated.dispatch(this);
+        if (_running.length == 0 && wasShutdown) terminated.dispatch(this);
     }

     /** Submits all the functions through submit and returns their Futures. */


taking into account columns that no longer exist

--- WeaveData/src/weave/data/DataSources/CSVDataSource.as
+++ WeaveData/src/weave/data/DataSources/CSVDataSource.as
@@ -414,7 +414,11 @@
 			if (metadata.hasOwnProperty(METADATA_COLUMN_INDEX))
 				return new CSVColumnNode(this, metadata[METADATA_COLUMN_INDEX]);
 			if (metadata.hasOwnProperty(METADATA_COLUMN_NAME))
-				return new CSVColumnNode(this, getColumnNames().indexOf(metadata[METADATA_COLUMN_NAME]));
+			{
+				var index:int = getColumnNames().indexOf(metadata[METADATA_COLUMN_NAME]);
+				if (index >= 0)
+					return new CSVColumnNode(this, index);
+			}

 			return null;
 		}
@@ -515,6 +519,12 @@
 				colIndex = colNames.indexOf(columnId);
 				colName = String(columnId);
 			}
+			if (colIndex < 0)
+			{
+				proxyColumn.setInternalColumn(ProxyColumn.undefinedColumn);
+				return;
+			}
+
 			if (!metadata[ColumnMetadata.TITLE])
 				metadata[ColumnMetadata.TITLE] = colName;

@@ -597,7 +607,7 @@
 		/**
 		 * @param rows The rows to get values from.
 		 * @param columnIndex If this is -1, record index values will be returned.  Otherwise, this specifies which column to get values from.
-		 * @return A list of values from the specified column, excluding the first row, which is the header.
+		 * @param outputArrayOrVector Output Array or Vector to store the values from the specified column, excluding the first row, which is the header.
 		 */
 		private function getColumnValues(rows:Array, columnIndex:int, outputArrayOrVector:*):void
 		{


fixed typo calling wrong function

fixed typo calling wrong function

--- WeaveJS/src/WeaveJS.as
+++ WeaveJS/src/WeaveJS.as
@@ -60,7 +60,7 @@
 				'weavejs.util'
 			);

-			WeaveAPI.ClassRegistry.registerSingletonImplementation(ILinkableHashMap, LinkableHashMap);
+			WeaveAPI.ClassRegistry.registerImplementation(ILinkableHashMap, LinkableHashMap);
 			WeaveAPI.ClassRegistry.registerSingletonImplementation(IURLRequestUtils, URLRequestUtils);
 			WeaveAPI.ClassRegistry.registerSingletonImplementation(IAttributeColumnCache, AttributeColumnCache);
 			WeaveAPI.ClassRegistry.registerSingletonImplementation(ISessionManager, SessionManager);


Removed delay from Tween/Transitioner constructors

git-svn-id: 6aa7ccb0a2048310a30f08a72aaff4ca39d980ed@58 91848ab2-c4ae-4e4f-8e6a-6a52ea0dccc3

--- flare.demos/flare/demos/Animation.as
+++ flare.demos/flare/demos/Animation.as
@@ -45,7 +45,8 @@
 			x = WIDTH/2;
 			y = HEIGHT/2;

-			trans = new Transitioner(2.5, 0.5);
+			trans = new Transitioner(2.5);
+			trans.delay = 0.5;
 			var o:Object;
 			with (trans) {
 				// the $() function returns an object for setting target values


- Removed pointless "default" sorting method.
- Since quicksort is unstable anyway, might as well avoid a swap if two elements are equal.
- Be generous with the comparator function. It should really return -1, 0, 1, but sometimes people
  return positive numbers, 0, negative numbers...
- If Array.sort() is a stable sort, I think we should just change this impl to put all
  children into an array, sort'em, then set their indexes back into the parent.

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@423 ed5b42cb-e716-0410-a449-f6a68f950b19

--- src/as/com/threerings/flash/DisplayUtil.as
+++ src/as/com/threerings/flash/DisplayUtil.as
@@ -39,55 +39,10 @@
      * object should appear before the second in the container, 1 if it should appear after,
      * and 0 if the order does not matter. (Since quicksort is not a stable sort algorithm,
      * returning 0 in the compare function is equivalent to returning -1).
-     *
-     * If comp is null, sortDisplayChildren will sort container so that objects with smaller
-     * y-values appear before objects with larger y-values.
      */
-    public static function sortDisplayChildren (container :DisplayObjectContainer, comp :Function = null) :void
-    {
-        qsortDisplayChildren(container, 0, container.numChildren - 1, (null != comp ? comp : displayObjectYLessEqual));
-    }
-
-    private static function displayObjectYLessEqual (a :DisplayObject, b :DisplayObject) :int
-    {
-        return (a.y <= b.y ? -1 : 1);
-    }
-
-    /** Helper function for sortDisplayChildren. */
-    private static function qsortDisplayChildren (container :DisplayObjectContainer, left :int, right :int, comp :Function) :void
-    {
-        if (right - left > 1) { // containers of size 0 or 1 are already sorted
-
-            // arbitrarily choose the element in the middle of the sort list as the pivot element
-            var pivotIndex :int = left + ((right - left) * 0.5);
-
-            pivotIndex = partitionDisplayChildren(container, left, right, pivotIndex, comp);
-            qsortDisplayChildren(container, left, pivotIndex - 1, comp);
-            qsortDisplayChildren(container, pivotIndex + 1, right, comp);
-        }
-    }
-
-    /** Helper function for qsortDisplayChildren. */
-    private static function partitionDisplayChildren (
-        container :DisplayObjectContainer, left :int, right :int, pivotIndex :int, comp :Function) :int
-    {
-        var pivotObj :DisplayObject = container.getChildAt(pivotIndex);
-
-        container.swapChildrenAt(pivotIndex, right); // move pivot to end
-
-        var storeIndex :int = left;
-
-        for (var i :int = left; i < right; ++i) {
-            var thisObj :DisplayObject = container.getChildAt(i);
-            if (1 != comp(thisObj, pivotObj)) {
-                container.swapChildrenAt(i, storeIndex);
-                storeIndex += 1;
-            }
-        }
-
-        container.swapChildrenAt(storeIndex, right);
-
-        return storeIndex;
+    public static function sortDisplayChildren (container :DisplayObjectContainer, comp :Function) :void
+    {
+        qsortDisplayChildren(container, 0, container.numChildren - 1, comp);
     }

     /**
@@ -266,6 +221,44 @@
     public static function dumpHierarchy (top :DisplayObject) :String
     {
         return dumpHierarchy0(top);
+    }
+
+    /** Helper function for sortDisplayChildren. */
+    private static function qsortDisplayChildren (
+        container :DisplayObjectContainer, left :int, right :int, comp :Function) :void
+    {
+        if (right - left > 1) { // containers of size 0 or 1 are already sorted
+
+            // arbitrarily choose the element in the middle of the sort list as the pivot element
+            var pivotIndex :int = left + ((right - left) / 2);
+
+            pivotIndex = partitionDisplayChildren(container, left, right, pivotIndex, comp);
+            qsortDisplayChildren(container, left, pivotIndex - 1, comp);
+            qsortDisplayChildren(container, pivotIndex + 1, right, comp);
+        }
+    }
+
+    /** Helper function for qsortDisplayChildren. */
+    private static function partitionDisplayChildren (
+        container :DisplayObjectContainer, left :int, right :int, pivotIndex :int, comp :Function) :int
+    {
+        var pivotObj :DisplayObject = container.getChildAt(pivotIndex);
+
+        container.swapChildrenAt(pivotIndex, right); // move pivot to end
+
+        var storeIndex :int = left;
+
+        for (var i :int = left; i < right; ++i) {
+            var thisObj :DisplayObject = container.getChildAt(i);
+            if (0 > comp(thisObj, pivotObj)) {
+                container.swapChildrenAt(i, storeIndex);
+                storeIndex += 1;
+            }
+        }
+
+        container.swapChildrenAt(storeIndex, right);
+
+        return storeIndex;
     }

     /**


Change modifier of method Cloner.isAccessorCloneable() to private.

--- dolly-framework/src/main/actionscript/dolly/Cloner.as
+++ dolly-framework/src/main/actionscript/dolly/Cloner.as
@@ -14,7 +14,7 @@
 		return !variable.isStatic && (skipMetadataChecking || variable.hasMetadata(MetadataName.CLONEABLE));
 	}

-	public static function isAccessorCloneable(accessor:Accessor, skipMetadataChecking:Boolean = true):Boolean {
+	private static function isAccessorCloneable(accessor:Accessor, skipMetadataChecking:Boolean = true):Boolean {
 		return !accessor.isStatic && accessor.isReadable() && accessor.isWriteable() &&
 				(skipMetadataChecking || accessor.hasMetadata(MetadataName.CLONEABLE));
 	}


flashlsFlowplayer: trigger METADATA CHANGED event when duration is changing related to #160

--- src/org/mangui/flowplayer/HLSStreamProvider.as
+++ src/org/mangui/flowplayer/HLSStreamProvider.as
@@ -140,7 +140,10 @@
             _duration = event.mediatime.duration - _clipStart;
             // only update duration if not capped
             if (!_durationCapped) {
-                _clip.duration = _duration;
+                if(_clip.duration != _duration) {
+                    _clip.duration = _duration;
+                    _clip.dispatch(ClipEventType.METADATA_CHANGED);
+                }
             } else {
                 // ensure capped duration is lt real one
                 _durationCapped = Math.min(_durationCapped, _duration);


Transferred from the Adobe Open Source Subversion Repository

Revision: 17852
Author:   chiedozi@adobe.com
Date:     2010-09-24T21:27:53.988157Z

Log Message:
-----------
MobileApplicationBase now listens for application invoke events
The stage focus is now properly restored when an app is relaunched after being suspended by the OS
Fixed a small issue where a view wouldn't receive a viewDeactive event when the application closed

QE notes:
Doc notes:
Bugs: SDK-27943, SDK-27925
Reviewer: Ryan
Tests run:
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedMobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileApplicationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1264112 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigatorApplication.as
+++ frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigatorApplication.as
@@ -11,16 +11,21 @@

 package spark.components
 {
+import flash.events.Event;
+import flash.events.InvokeEvent;
 import flash.events.StageOrientationEvent;
 import flash.net.registerClassAlias;

 import mx.core.ContainerCreationPolicy;
+import mx.core.mx_internal;
 import mx.utils.BitFlagUtil;

 import spark.components.supportClasses.MobileApplicationBase;
 import spark.components.supportClasses.NavigationStack;
 import spark.components.supportClasses.ViewHistoryData;
 import spark.components.supportClasses.ViewNavigatorBase;
+
+use namespace mx_internal;

 [DefaultProperty("navigators")]

@@ -184,6 +189,36 @@
     //  Overridden Methods: MobileApplicationBase
     //
     //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function nativeApplication_invokeHandler(event:InvokeEvent):void
+    {
+        super.nativeApplication_invokeHandler(event);
+
+        // Set the stage focus to the navigator's active view
+        if (systemManager.stage.focus == null && navigator)
+        {
+            if (navigator.activeView)
+                systemManager.stage.focus = navigator.activeView;
+            else
+                systemManager.stage.focus = navigator;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function nativeApplication_deactivateHandler(event:Event):void
+    {
+        if (navigator && navigator.activeView)
+            navigator.activeView.setActive(false);
+
+        // super is called after so that the active view can get the
+        // viewDeactive event before the persistence process begins.
+        super.nativeApplication_deactivateHandler(event);
+    }

     /**
      *  @private


Transferred from the Adobe Open Source Subversion Repository

Revision: 21594
Author:   deeptika@adobe.com
Date:     2011-07-18T11:39:38.158141Z

Log Message:
-----------
Changing the style setting mechanism in charts (moving to defaults.css) to fix memory leak in charts.
QE notes:
Doc notes:
Bugs: FLEXDMV-2626 (Views with charts not getting GC-ed)
Reviewer:
Tests run: Mustella test suite for charts - cyclone tested by QE
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/charts.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/chartClasses/CartesianChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/chartClasses/ChartBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/series/AreaSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/BubbleChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/chartClasses/PolarChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/ColumnChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/charts-4.X.0.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/GridLines.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/series/PieSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/series/PlotSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/BarChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/series/CandlestickSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/AreaChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/series/HLOCSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/AxisRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/series/LineSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/PieChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/series/BubbleSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/PlotChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/series/ColumnSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/CandlestickChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/charts-3.0.0.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/HLOCChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/LineChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/series/BarSeries.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1252909 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/charts/src/mx/charts/LineChart.as
+++ frameworks/projects/charts/src/mx/charts/LineChart.as
@@ -20,11 +20,12 @@
 import mx.charts.renderers.LineRenderer;
 import mx.charts.styles.HaloDefaults;
 import mx.core.ClassFactory;
+import mx.core.IFlexModuleFactory;
+import mx.core.mx_internal;
 import mx.graphics.SolidColor;
+import mx.graphics.SolidColorStroke;
 import mx.graphics.Stroke;
 import mx.styles.CSSStyleDeclaration;
-import mx.core.IFlexModuleFactory;
-import mx.core.mx_internal;

 use namespace mx_internal;

@@ -143,23 +144,14 @@
     {
         HaloDefaults.init(styleManager);

-        var lineChartStyle:CSSStyleDeclaration =
-            HaloDefaults.createSelector("mx.charts.LineChart", styleManager);
-
         var lineChartSeriesStyles:Array /* of Object */ = [];
-
-        lineChartStyle.defaultFactory = function():void
-        {
-            this.axisColor = 0xD5DEDD;
-            this.chartSeriesStyles = lineChartSeriesStyles;
-            this.dataTipRenderer = DataTip;
-            this.fill = new SolidColor(0xFFFFFF, 0);
-            this.calloutStroke = new Stroke(0x888888,2);
-            this.fontSize = 10;
-            this.textAlign = "left";
-            this.horizontalAxisStyleNames = ["hangingCategoryAxis"];
-            this.verticalAxisStyleNames = ["blockNumericAxis"];
-        }
+
+		var lineChartStyle:CSSStyleDeclaration = styleManager.getStyleDeclaration("mx.charts.LineChart");
+		lineChartStyle.setStyle("chartSeriesStyles", lineChartSeriesStyles);
+		lineChartStyle.setStyle("fill", new SolidColor(0xFFFFFF, 0));
+		lineChartStyle.setStyle("calloutStroke", new SolidColorStroke(0x888888,2));
+		lineChartStyle.setStyle("horizontalAxisStyleNames", ["hangingCategoryAxis"]);
+		lineChartStyle.setStyle("verticalAxisStyleNames", ["blockNumericAxis"]);

         var n:int = HaloDefaults.defaultColors.length;
         for (var i:int = 0; i < n; i++)